File tree 1 file changed +10
-14
lines changed 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -159,25 +159,21 @@ impl Config {
159
159
let mut copy = self . clone ( ) ;
160
160
modify_fn ( & mut copy) ;
161
161
162
- // Save port configuration
163
- let port_serialized = toml:: to_string ( & copy. port_config )
162
+ let serialized = toml:: to_string ( & copy. port_config )
164
163
. into_diagnostic ( )
165
- . wrap_err ( "Failed to serialize port config" ) ?;
166
- if let Some ( parent) = copy. port_config . save_path . parent ( ) {
167
- create_dir_all ( parent)
168
- . into_diagnostic ( )
169
- . wrap_err ( "Failed to create port config directory" ) ?;
170
- }
171
- write ( & copy. port_config . save_path , port_serialized)
164
+ . wrap_err ( "Failed to serialize config" ) ?;
165
+
166
+ create_dir_all ( self . port_config . save_path . parent ( ) . unwrap ( ) )
167
+ . into_diagnostic ( )
168
+ . wrap_err ( "Failed to create config directory" ) ?;
169
+ write ( & self . port_config . save_path , serialized)
172
170
. into_diagnostic ( )
173
171
. wrap_err_with ( || {
174
172
format ! (
175
- "Failed to write port config to {}" ,
176
- copy . port_config. save_path. display( )
173
+ "Failed to write config to {}" ,
174
+ self . port_config. save_path. display( )
177
175
)
178
- } ) ?;
179
-
180
- Ok ( ( ) )
176
+ } )
181
177
}
182
178
183
179
fn project_config_path ( ) -> Result < PathBuf , Error > {
You can’t perform that action at this time.
0 commit comments