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) }