diff options
author | DLFW <daniel@llin.info> | 2022-02-02 03:23:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 21:23:38 -0500 |
commit | e29904dcd71a864eb7b33df55f800e885b870fd4 (patch) | |
tree | eb9d80b875b3dbdac268d60454d55810a758f1d6 /src/config | |
parent | 65f937083bf6e26b178550d7936dd288ba024e53 (diff) |
code cleanup (#135)
* code cleanup
Remove dead code and unused imports around preview features.
* Remove unused config option [display]show_preview
* Remove config option [preview]preview_images
* Remove unused imports
* Remove dead code and unused imports
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/general/display_crude.rs | 5 | ||||
-rw-r--r-- | src/config/general/preview_crude.rs | 4 | ||||
-rw-r--r-- | src/config/keymap/keymapping.rs | 2 | ||||
-rw-r--r-- | src/config/option/display_option.rs | 6 | ||||
-rw-r--r-- | src/config/option/preview_option.rs | 2 |
5 files changed, 0 insertions, 19 deletions
diff --git a/src/config/general/display_crude.rs b/src/config/general/display_crude.rs index 409091a..bc4cf45 100644 --- a/src/config/general/display_crude.rs +++ b/src/config/general/display_crude.rs @@ -43,9 +43,6 @@ pub struct DisplayOptionCrude { pub show_icons: bool, #[serde(default = "default_true")] - pub show_preview: bool, - - #[serde(default = "default_true")] pub tilde_in_titlebar: bool, #[serde(default, rename = "sort")] @@ -65,7 +62,6 @@ impl std::default::Default for DisplayOptionCrude { show_borders: true, show_hidden: false, show_icons: false, - show_preview: true, sort_options: SortOptionCrude::default(), tilde_in_titlebar: true, line_number_style: "none".to_string(), @@ -107,7 +103,6 @@ impl From<DisplayOptionCrude> for DisplayOption { _show_borders: crude.show_borders, _show_hidden: crude.show_hidden, _show_icons: crude.show_icons, - _show_preview: crude.show_preview, _sort_options: crude.sort_options.into(), _tilde_in_titlebar: crude.tilde_in_titlebar, _line_nums, diff --git a/src/config/general/preview_crude.rs b/src/config/general/preview_crude.rs index 8ba88d9..6a5b4ff 100644 --- a/src/config/general/preview_crude.rs +++ b/src/config/general/preview_crude.rs @@ -16,8 +16,6 @@ pub struct PreviewOptionCrude { #[serde(default = "default_max_preview_size")] pub max_preview_size: u64, #[serde(default)] - pub preview_images: bool, - #[serde(default)] pub preview_script: Option<String>, #[serde(default)] pub preview_shown_hook_script: Option<String>, @@ -29,7 +27,6 @@ impl std::default::Default for PreviewOptionCrude { fn default() -> Self { Self { max_preview_size: default_max_preview_size(), - preview_images: false, preview_script: None, preview_shown_hook_script: None, preview_removed_hook_script: None, @@ -66,7 +63,6 @@ impl From<PreviewOptionCrude> for PreviewOption { Self { max_preview_size: crude.max_preview_size, - preview_images: crude.preview_images, preview_script, preview_shown_hook_script, preview_removed_hook_script, diff --git a/src/config/keymap/keymapping.rs b/src/config/keymap/keymapping.rs index 341db95..8d8b108 100644 --- a/src/config/keymap/keymapping.rs +++ b/src/config/keymap/keymapping.rs @@ -5,8 +5,6 @@ use std::convert::{AsMut, AsRef, From}; use std::str::FromStr; use termion::event::Event; -#[cfg(feature = "mouse")] -use termion::event::MouseEvent; use crate::config::{parse_to_config_file, TomlConfigFile}; use crate::error::JoshutoResult; diff --git a/src/config/option/display_option.rs b/src/config/option/display_option.rs index 6454a1b..1749ece 100644 --- a/src/config/option/display_option.rs +++ b/src/config/option/display_option.rs @@ -16,7 +16,6 @@ pub struct DisplayOption { pub _show_borders: bool, pub _show_hidden: bool, pub _show_icons: bool, - pub _show_preview: bool, pub _sort_options: SortOption, pub _tilde_in_titlebar: bool, pub _line_nums: LineNumberStyle, @@ -57,10 +56,6 @@ impl DisplayOption { self._show_icons } - pub fn show_preview(&self) -> bool { - self._show_preview - } - pub fn set_show_hidden(&mut self, show_hidden: bool) { self._show_hidden = show_hidden; } @@ -118,7 +113,6 @@ impl std::default::Default for DisplayOption { _show_borders: true, _show_hidden: false, _show_icons: false, - _show_preview: true, _sort_options: SortOption::default(), _tilde_in_titlebar: true, _line_nums: LineNumberStyle::None, diff --git a/src/config/option/preview_option.rs b/src/config/option/preview_option.rs index 14c1e7e..3102350 100644 --- a/src/config/option/preview_option.rs +++ b/src/config/option/preview_option.rs @@ -7,7 +7,6 @@ const fn default_max_preview_size() -> u64 { #[derive(Clone, Debug)] pub struct PreviewOption { pub max_preview_size: u64, - pub preview_images: bool, pub preview_script: Option<path::PathBuf>, pub preview_shown_hook_script: Option<path::PathBuf>, pub preview_removed_hook_script: Option<path::PathBuf>, @@ -17,7 +16,6 @@ impl std::default::Default for PreviewOption { fn default() -> Self { Self { max_preview_size: default_max_preview_size(), - preview_images: false, preview_script: None, preview_shown_hook_script: None, preview_removed_hook_script: None, |