diff options
Diffstat (limited to 'alacritty/src/config')
-rw-r--r-- | alacritty/src/config/bindings.rs | 15 | ||||
-rw-r--r-- | alacritty/src/config/mod.rs | 2 | ||||
-rw-r--r-- | alacritty/src/config/ui_config.rs | 4 |
3 files changed, 11 insertions, 10 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: \ diff --git a/alacritty/src/config/mod.rs b/alacritty/src/config/mod.rs index e2476bb2..840a4b68 100644 --- a/alacritty/src/config/mod.rs +++ b/alacritty/src/config/mod.rs @@ -157,7 +157,7 @@ fn load_from(path: &Path, cli_config: Value) -> Result<Config> { /// Deserialize configuration file from path. fn read_config(path: &Path, cli_config: Value) -> Result<Config> { let mut config_paths = Vec::new(); - let mut config_value = parse_config(&path, &mut config_paths, IMPORT_RECURSION_LIMIT)?; + let mut config_value = parse_config(path, &mut config_paths, IMPORT_RECURSION_LIMIT)?; // Override config with CLI options. config_value = serde_utils::merge(config_value, cli_config); diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index a58c1fd3..cf0f9298 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -121,7 +121,7 @@ impl UiConfig { #[inline] pub fn key_bindings(&self) -> &[KeyBinding] { - &self.key_bindings.0.as_slice() + self.key_bindings.0.as_slice() } #[inline] @@ -399,7 +399,7 @@ impl LazyRegexVariant { }; // Compile the regex. - let regex_search = match RegexSearch::new(®ex) { + let regex_search = match RegexSearch::new(regex) { Ok(regex_search) => regex_search, Err(error) => { error!("hint regex is invalid: {}", error); |