refactor(config): inline buffer creation

This commit is contained in:
Philipp Matthias Schaefer 2021-02-25 20:06:06 +01:00
parent a6c7df0cb0
commit 6b35594f1a

View File

@ -49,9 +49,7 @@ pub fn load_config(file_path: &str) -> Config {
Err(_) => exit_with_error(&format!("Failed to open configuration file '{}'", file_path))
};
let reader = BufReader::new(file);
match serde_json::from_reader::<BufReader<_>, Config>(reader) {
match serde_json::from_reader(BufReader::new(file)) {
Ok(config) => check_config(config),
Err(_) => exit_with_error(&format!("Failed to parse configuration file '{}'", file_path))
}