diff --git a/src/app.rs b/src/app.rs index 20445c0..8e25a1b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -214,7 +214,7 @@ impl App { let mut load_errs = vec![]; for config_file in config_files { - match lua::extend(lua, &config_file.to_string_lossy().to_string()) { + match lua::extend(lua, &config_file.to_string_lossy()) { Ok(c) => { config = c; } @@ -750,10 +750,7 @@ impl App { fn back(self) -> Result { PathBuf::from(self.pwd.clone()) .parent() - .map(|p| { - self.clone() - .change_directory(&p.to_string_lossy().to_string(), true) - }) + .map(|p| self.clone().change_directory(&p.to_string_lossy(), true)) .unwrap_or(Ok(self)) } @@ -937,11 +934,8 @@ impl App { } if let Some(parent) = pathbuf.parent() { if let Some(filename) = pathbuf.file_name() { - self.change_directory(&parent.to_string_lossy().to_string(), false)? - .focus_by_file_name( - &filename.to_string_lossy().to_string(), - save_history, - ) + self.change_directory(&parent.to_string_lossy(), false)? + .focus_by_file_name(&filename.to_string_lossy(), save_history) } else { self.log_error(format!("{} not found", path)) } diff --git a/src/config.rs b/src/config.rs index 4937f80..92a71fb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,7 +14,7 @@ use std::collections::BTreeMap; use std::collections::HashMap; use std::collections::HashSet; -#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct Action { #[serde(default)] @@ -280,7 +280,7 @@ pub struct GeneralConfig { pub global_key_bindings: KeyBindings, } -#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct KeyBindings { #[serde(default)] diff --git a/src/ui.rs b/src/ui.rs index 5b29a8d..396d37d 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -48,7 +48,7 @@ fn string_to_text<'a>(string: String) -> Text<'a> { } } -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub struct LayoutOptions { #[serde(default)] @@ -74,7 +74,7 @@ impl LayoutOptions { } } -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub enum ContentBody { /// A paragraph to render @@ -292,7 +292,7 @@ impl Into for Style { } } -#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub enum Constraint { Percentage(u16), @@ -1169,7 +1169,7 @@ pub fn draw_custom_content( } } -#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Rect { x: u16, y: u16,