From 415122ea301b83603b0f65cb5404beac24356471 Mon Sep 17 00:00:00 2001 From: Penwing Date: Fri, 26 Jan 2024 09:50:51 +0100 Subject: [PATCH] ran clippy --- src/tools/mod.rs | 11 +---------- src/tools/tabs.rs | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/tools/mod.rs b/src/tools/mod.rs index 512982e..47c6c0e 100644 --- a/src/tools/mod.rs +++ b/src/tools/mod.rs @@ -21,21 +21,12 @@ pub use terminal::*; pub mod tabs; pub use tabs::*; -#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Default)] pub struct AppState { pub tabs: Vec, pub theme: usize, } -impl Default for AppState { - fn default() -> Self { - Self { - tabs: vec![], - theme: 0, - } - } -} - pub fn save_state(state: &AppState, file_path: &str) -> Result<(), std::io::Error> { let serialized_state = serde_json::to_string(state)?; diff --git a/src/tools/tabs.rs b/src/tools/tabs.rs index 9fa06bf..a8ab173 100644 --- a/src/tools/tabs.rs +++ b/src/tools/tabs.rs @@ -86,7 +86,7 @@ impl Tab { } fn read_file_contents(path: &Path) -> String { - read_to_string(path.to_path_buf()) + read_to_string(path) .map_err(|err| format!("// Error reading file: {}", err)) .unwrap_or_else(|err_msg| err_msg) }