File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use std::io;
22use std:: path:: { Path , PathBuf } ;
33
44use either:: { Either , Left , Right } ;
5+ use figment:: error:: Kind ;
56use tokio:: time:: { sleep, Duration } ;
67
78use crate :: fs:: NamedFile ;
@@ -79,8 +80,11 @@ impl Bind for UnixListener {
7980 let path = endpoint. unix ( )
8081 . ok_or_else ( || Right ( io:: Error :: other ( "internal error: invalid endpoint" ) ) ) ?;
8182
82- let reuse: Option < bool > = rocket. figment ( ) . extract_inner ( "reuse" ) . map_err ( Left ) ?;
83- Ok ( Self :: bind ( path, reuse. unwrap_or ( true ) ) . await . map_err ( Right ) ?)
83+ let reuse: bool = rocket. figment ( )
84+ . extract_inner ( "reuse" )
85+ . or_else ( |e| if e. missing ( ) { Ok ( true ) } else { Err ( e) } )
86+ . map_err ( Left ) ?;
87+ Ok ( Self :: bind ( path, reuse) . await . map_err ( Right ) ?)
8488 }
8589
8690 fn bind_endpoint ( rocket : & Rocket < Ignite > ) -> Result < Endpoint , Self :: Error > {
You can’t perform that action at this time.
0 commit comments