ran clippy

This commit is contained in:
Penwing 2024-01-26 09:50:51 +01:00
parent b7b924d6b4
commit 415122ea30
2 changed files with 2 additions and 11 deletions

View file

@ -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<PathBuf>,
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)?;

View file

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