From 6b35594f1a78c32353a9d7cf8a92dd8125a0fdf4 Mon Sep 17 00:00:00 2001 From: Philipp Matthias Schaefer Date: Thu, 25 Feb 2021 20:06:06 +0100 Subject: [PATCH] refactor(config): inline buffer creation --- src/config.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 59026f1..7d99b84 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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::, 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)) }