refactor(config): inline buffer creation
This commit is contained in:
parent
a6c7df0cb0
commit
6b35594f1a
@ -49,9 +49,7 @@ pub fn load_config(file_path: &str) -> Config {
|
|||||||
Err(_) => exit_with_error(&format!("Failed to open configuration file '{}'", file_path))
|
Err(_) => exit_with_error(&format!("Failed to open configuration file '{}'", file_path))
|
||||||
};
|
};
|
||||||
|
|
||||||
let reader = BufReader::new(file);
|
match serde_json::from_reader(BufReader::new(file)) {
|
||||||
|
|
||||||
match serde_json::from_reader::<BufReader<_>, Config>(reader) {
|
|
||||||
Ok(config) => check_config(config),
|
Ok(config) => check_config(config),
|
||||||
Err(_) => exit_with_error(&format!("Failed to parse configuration file '{}'", file_path))
|
Err(_) => exit_with_error(&format!("Failed to parse configuration file '{}'", file_path))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user