@@ -128,25 +128,27 @@ fn replace_tilde(config_path: &Path, dirs_wrapper: &dyn DirsWrapper) -> Option<P
128
128
. to_str ( )
129
129
. expect ( "expected str home_dir" )
130
130
. to_string ( ) ;
131
- Some ( PathBuf :: from ( config_path
132
- . display ( )
133
- . to_string ( )
134
- . replacen ( '~' , home_dir_from_wrapper. as_str ( ) , 1 ) ) )
131
+ Some ( PathBuf :: from ( config_path. display ( ) . to_string ( ) . replacen (
132
+ '~' ,
133
+ home_dir_from_wrapper. as_str ( ) ,
134
+ 1 ,
135
+ ) ) )
135
136
}
136
- false => None
137
+ false => None ,
137
138
}
138
-
139
139
}
140
140
141
141
fn replace_dots ( config_path : & Path , panic : & mut bool ) -> Option < PathBuf > {
142
142
match config_path. starts_with ( "./" ) || config_path. starts_with ( "../" ) {
143
143
true => {
144
144
* panic = false ;
145
- Some ( current_dir ( )
146
- . expect ( "expected current dir" )
147
- . join ( config_path) )
145
+ Some (
146
+ current_dir ( )
147
+ . expect ( "expected current dir" )
148
+ . join ( config_path) ,
149
+ )
148
150
}
149
- false => None
151
+ false => None ,
150
152
}
151
153
}
152
154
@@ -166,8 +168,8 @@ fn replace_relative_path(
166
168
* panic = true ;
167
169
Some ( config_path. to_path_buf ( ) )
168
170
}
169
- }
170
- false => None
171
+ } ,
172
+ false => None ,
171
173
}
172
174
}
173
175
@@ -187,26 +189,22 @@ fn get_config_file_from_mc(
187
189
replace_relative_path ( & config_path, data_directory_def, data_directory, & mut panic) ;
188
190
let config_file_pth = match config_file_pth_tilde {
189
191
Some ( path) => {
190
- panic = false ;
191
- path
192
- } ,
192
+ panic = false ;
193
+ path
194
+ }
193
195
None => match config_file_pth_dot {
194
196
Some ( config_path) => {
195
197
panic = false ;
196
198
config_path
197
199
}
198
- None => {
199
- match config_file_pth_relative {
200
- Some ( path_rel) => {
201
- path_rel
202
- }
203
- None => {
204
- panic = false ;
205
- PathBuf :: from ( "config.toml" )
206
- }
200
+ None => match config_file_pth_relative {
201
+ Some ( path_rel) => path_rel,
202
+ None => {
203
+ panic = false ;
204
+ PathBuf :: from ( "config.toml" )
207
205
}
208
- }
209
- }
206
+ } ,
207
+ } ,
210
208
} ;
211
209
if panic {
212
210
panic ! (
0 commit comments