File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -114,17 +114,17 @@ impl Client {
114
114
} ) ?;
115
115
let path = Path :: new ( path_str) ;
116
116
117
- let file = OpenOptions :: new ( )
118
- . read ( true )
119
- . write ( true )
120
- . open ( path)
121
- . map_err ( |err| FromEnvErrorInner :: CannotOpenPath ( path_str. to_string ( ) , err) ) ?;
117
+ let open_file = || {
118
+ OpenOptions :: new ( )
119
+ . read ( true )
120
+ . write ( true )
121
+ . open ( path)
122
+ . map_err ( |err| FromEnvErrorInner :: CannotOpenPath ( path_str. to_string ( ) , err) )
123
+ } ;
122
124
123
125
Ok ( Some ( Client {
124
- read : file
125
- . try_clone ( )
126
- . map_err ( |err| FromEnvErrorInner :: CannotClone ( file. as_raw_fd ( ) , err) ) ?,
127
- write : file,
126
+ read : open_file ( ) ?,
127
+ write : open_file ( ) ?,
128
128
creation_arg : ClientCreationArg :: Fifo ( path. into ( ) ) ,
129
129
is_non_blocking : Some ( AtomicBool :: new ( false ) ) ,
130
130
} ) )
You can’t perform that action at this time.
0 commit comments