ran clippy
This commit is contained in:
parent
b7b924d6b4
commit
415122ea30
|
@ -21,21 +21,12 @@ pub use terminal::*;
|
||||||
pub mod tabs;
|
pub mod tabs;
|
||||||
pub use tabs::*;
|
pub use tabs::*;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Default)]
|
||||||
pub struct AppState {
|
pub struct AppState {
|
||||||
pub tabs: Vec<PathBuf>,
|
pub tabs: Vec<PathBuf>,
|
||||||
pub theme: usize,
|
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> {
|
pub fn save_state(state: &AppState, file_path: &str) -> Result<(), std::io::Error> {
|
||||||
let serialized_state = serde_json::to_string(state)?;
|
let serialized_state = serde_json::to_string(state)?;
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ impl Tab {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_file_contents(path: &Path) -> String {
|
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))
|
.map_err(|err| format!("// Error reading file: {}", err))
|
||||||
.unwrap_or_else(|err_msg| err_msg)
|
.unwrap_or_else(|err_msg| err_msg)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue