File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ impl LogWriter {
119
119
None => tracing:: debug!( "{}" , full_error_message) ,
120
120
}
121
121
if self . inner . is_none ( ) {
122
- let mut open_failed = false ;
123
- self . inner = self . path . as_ref ( ) . and_then ( |path| {
122
+ if let Some ( path) = self . path . as_ref ( ) {
124
123
match std:: fs:: OpenOptions :: new ( )
125
124
. create ( true )
126
125
. append ( true )
@@ -133,14 +132,11 @@ impl LogWriter {
133
132
& path. to_string_lossy( ) ,
134
133
e
135
134
) ;
136
- open_failed = true ;
137
- None
135
+ self . path = None ;
136
+ self . inner = None
138
137
}
139
- Ok ( file) => Some ( std:: io:: BufWriter :: new ( file) ) ,
138
+ Ok ( file) => self . inner = Some ( std:: io:: BufWriter :: new ( file) ) ,
140
139
}
141
- } ) ;
142
- if open_failed {
143
- self . path = None
144
140
}
145
141
}
146
142
if let Some ( mut writer) = self . inner . as_mut ( ) {
You can’t perform that action at this time.
0 commit comments