diff options
author | Christian Duerr <contact@christianduerr.com> | 2021-07-03 03:06:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-03 03:06:52 +0000 |
commit | 4dd70ba3a155d1eebe38bcd5a5c4c03ca09f2fea (patch) | |
tree | 5fd25b77c2d46279cf3e23b699d47e06f02d43e4 /alacritty/src/config/bindings.rs | |
parent | b0bc2a2440287268ca47ecf618c73766db9a2586 (diff) | |
download | r-alacritty-4dd70ba3a155d1eebe38bcd5a5c4c03ca09f2fea.tar.gz r-alacritty-4dd70ba3a155d1eebe38bcd5a5c4c03ca09f2fea.tar.bz2 r-alacritty-4dd70ba3a155d1eebe38bcd5a5c4c03ca09f2fea.zip |
Fix clippy warnings
Diffstat (limited to 'alacritty/src/config/bindings.rs')
-rw-r--r-- | alacritty/src/config/bindings.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index 12349639..c324459e 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -103,11 +103,11 @@ pub enum Action { /// Perform vi mode action. #[config(skip)] - ViAction(ViAction), + Vi(ViAction), /// Perform search mode action. #[config(skip)] - SearchAction(SearchAction), + Search(SearchAction), /// Paste contents of system clipboard. Paste, @@ -211,7 +211,7 @@ impl From<&'static str> for Action { impl From<ViAction> for Action { fn from(action: ViAction) -> Self { - Self::ViAction(action) + Self::Vi(action) } } @@ -223,7 +223,7 @@ impl From<ViMotion> for Action { impl From<SearchAction> for Action { fn from(action: SearchAction) -> Self { - Self::SearchAction(action) + Self::Search(action) } } @@ -232,7 +232,7 @@ impl Display for Action { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Action::ViMotion(motion) => motion.fmt(f), - Action::ViAction(action) => action.fmt(f), + Action::Vi(action) => action.fmt(f), _ => write!(f, "{:?}", self), } } @@ -262,6 +262,7 @@ pub enum ViAction { } /// Search mode specific actions. +#[allow(clippy::enum_variant_names)] #[derive(ConfigDeserialize, Debug, Copy, Clone, PartialEq, Eq)] pub enum SearchAction { /// Move the focus to the next search match. @@ -1081,7 +1082,7 @@ impl<'a> Deserialize<'a> for RawBinding { let action = match (action, chars, command) { (Some(action @ Action::ViMotion(_)), None, None) - | (Some(action @ Action::ViAction(_)), None, None) => { + | (Some(action @ Action::Vi(_)), None, None) => { if !mode.intersects(BindingMode::VI) || not_mode.intersects(BindingMode::VI) { return Err(V::Error::custom(format!( @@ -1091,7 +1092,7 @@ impl<'a> Deserialize<'a> for RawBinding { } action }, - (Some(action @ Action::SearchAction(_)), None, None) => { + (Some(action @ Action::Search(_)), None, None) => { if !mode.intersects(BindingMode::SEARCH) { return Err(V::Error::custom(format!( "action `{}` is only available in search mode, try adding `mode: \ |