Skip to content

Commit dd290ea

Browse files
committed
formatting
1 parent 151ab18 commit dd290ea

File tree

1 file changed

+24
-26
lines changed
  • node/src/node_configurator

1 file changed

+24
-26
lines changed

node/src/node_configurator/mod.rs

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,27 @@ fn replace_tilde(config_path: &Path, dirs_wrapper: &dyn DirsWrapper) -> Option<P
128128
.to_str()
129129
.expect("expected str home_dir")
130130
.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+
)))
135136
}
136-
false => None
137+
false => None,
137138
}
138-
139139
}
140140

141141
fn replace_dots(config_path: &Path, panic: &mut bool) -> Option<PathBuf> {
142142
match config_path.starts_with("./") || config_path.starts_with("../") {
143143
true => {
144144
*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+
)
148150
}
149-
false => None
151+
false => None,
150152
}
151153
}
152154

@@ -166,8 +168,8 @@ fn replace_relative_path(
166168
*panic = true;
167169
Some(config_path.to_path_buf())
168170
}
169-
}
170-
false => None
171+
},
172+
false => None,
171173
}
172174
}
173175

@@ -187,26 +189,22 @@ fn get_config_file_from_mc(
187189
replace_relative_path(&config_path, data_directory_def, data_directory, &mut panic);
188190
let config_file_pth = match config_file_pth_tilde {
189191
Some(path) => {
190-
panic = false;
191-
path
192-
},
192+
panic = false;
193+
path
194+
}
193195
None => match config_file_pth_dot {
194196
Some(config_path) => {
195197
panic = false;
196198
config_path
197199
}
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")
207205
}
208-
}
209-
}
206+
},
207+
},
210208
};
211209
if panic {
212210
panic!(

0 commit comments

Comments
 (0)