From c53020ceafd33c63ee67e180505fa51124d1cba7 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 26 Feb 2025 14:45:04 -0500 Subject: [PATCH] vim: Combine match arms in `Mode::is_visual` (#25675) This PR refactors the `Mode::is_visual` implementation to combine some of the `match` arms. Release Notes: - N/A --- crates/vim/src/state.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/vim/src/state.rs b/crates/vim/src/state.rs index a60082c9d04aec1125e57c71cb489a6849fd0385..b5ce364ae0519f0b0c04545ffa4d0efb1761d930 100644 --- a/crates/vim/src/state.rs +++ b/crates/vim/src/state.rs @@ -45,9 +45,8 @@ impl Display for Mode { impl Mode { pub fn is_visual(&self) -> bool { match self { - Mode::Normal | Mode::Insert | Mode::Replace => false, - Mode::Visual | Mode::VisualLine | Mode::VisualBlock => true, - Mode::HelixNormal => false, + Self::Visual | Self::VisualLine | Self::VisualBlock => true, + Self::Normal | Self::Insert | Self::Replace | Self::HelixNormal => false, } } }