diff options
author | a-kenji <aks.kenji@protonmail.com> | 2022-06-10 20:03:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 20:03:13 +0200 |
commit | 67d2673cae60954e8287c2a1f58a21a56e066afb (patch) | |
tree | 5c469728075ea59723951c6b535253e30ebeaec4 /zellij-utils/src | |
parent | bcaa6b82c5c3eec824110387b396aacae3a52e21 (diff) |
add(style): add trailing comma in match blocks (#1483)
This makes it easier to distinguish from normal blocks
Diffstat (limited to 'zellij-utils/src')
-rw-r--r-- | zellij-utils/src/input/config.rs | 4 | ||||
-rw-r--r-- | zellij-utils/src/input/keybinds.rs | 12 | ||||
-rw-r--r-- | zellij-utils/src/input/layout.rs | 22 | ||||
-rw-r--r-- | zellij-utils/src/input/mod.rs | 10 | ||||
-rw-r--r-- | zellij-utils/src/input/plugins.rs | 4 | ||||
-rw-r--r-- | zellij-utils/src/ipc.rs | 2 | ||||
-rw-r--r-- | zellij-utils/src/setup.rs | 28 | ||||
-rw-r--r-- | zellij-utils/src/shared.rs | 2 |
8 files changed, 42 insertions, 42 deletions
diff --git a/zellij-utils/src/input/config.rs b/zellij-utils/src/input/config.rs index 811f5d54c..4b9f4100b 100644 --- a/zellij-utils/src/input/config.rs +++ b/zellij-utils/src/input/config.rs @@ -131,7 +131,7 @@ impl Config { return Ok(Config::default()); } return Err(ConfigError::Serde(e)); - } + }, Ok(config) => config, }; @@ -149,7 +149,7 @@ impl Config { file.read_to_string(&mut yaml_config) .map_err(|e| ConfigError::IoPath(e, path.to_path_buf()))?; Ok(Config::from_yaml(&yaml_config)?) - } + }, Err(e) => Err(ConfigError::IoPath(e, path.into())), } } diff --git a/zellij-utils/src/input/keybinds.rs b/zellij-utils/src/input/keybinds.rs index 4838fdf64..83177793a 100644 --- a/zellij-utils/src/input/keybinds.rs +++ b/zellij-utils/src/input/keybinds.rs @@ -113,12 +113,12 @@ impl Keybinds { match keybind { KeyActionUnbind::Unbind(unbind) => { unbind_config.insert(mode, unbind.unbind.clone()); - } + }, KeyActionUnbind::KeyAction(key_action_from_yaml) => { keybind_config .0 .insert(mode, ModeKeybinds::from(key_action_from_yaml.clone())); - } + }, } } } @@ -145,19 +145,19 @@ impl Keybinds { for mode in InputMode::iter() { if let Some(unbind) = unbind.get(&mode) { match unbind { - Unbind::All(true) => {} + Unbind::All(true) => {}, Unbind::Keys(keys) => { if let Some(defaults) = self.0.get(&mode) { keybinds .0 .insert(mode, defaults.clone().unbind_keys(keys.to_vec())); } - } + }, Unbind::All(false) => { if let Some(defaults) = self.0.get(&mode) { keybinds.0.insert(mode, defaults.clone()); } - } + }, } } else if let Some(defaults) = self.0.get(&mode) { keybinds.0.insert(mode, defaults.clone()); @@ -210,7 +210,7 @@ impl Keybinds { match *mode { InputMode::Normal | InputMode::Locked => { mode_keybind_or_action(Action::Write(raw_bytes)) - } + }, InputMode::RenameTab => mode_keybind_or_action(Action::TabNameInput(raw_bytes)), InputMode::RenamePane => mode_keybind_or_action(Action::PaneNameInput(raw_bytes)), _ => mode_keybind_or_action(Action::NoOp), diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index 4c1131254..b7eff7bda 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -201,7 +201,7 @@ impl LayoutFromYamlIntermediate { return Ok(LayoutFromYamlIntermediate::default()); } return Err(ConfigError::Serde(e)); - } + }, Ok(config) => config, }; @@ -211,7 +211,7 @@ impl LayoutFromYamlIntermediate { tab.check()?; } Ok(layout) - } + }, None => Ok(LayoutFromYamlIntermediate::default()), } } @@ -225,7 +225,7 @@ impl LayoutFromYamlIntermediate { return Ok(LayoutFromYamlIntermediate::default()); } return Err(ConfigError::Serde(e)); - } + }, Ok(config) => config, }; Ok(layout) @@ -276,7 +276,7 @@ impl LayoutFromYamlIntermediate { } else { LayoutFromYamlIntermediate::from_default_assets(layout) } - } + }, None => LayoutFromYamlIntermediate::from_default_assets(layout), } } @@ -341,7 +341,7 @@ impl LayoutFromYaml { return Ok(LayoutFromYaml::default()); } return Err(ConfigError::Serde(e)); - } + }, Ok(config) => config, }; @@ -351,7 +351,7 @@ impl LayoutFromYaml { tab.check()?; } Ok(layout) - } + }, None => Ok(LayoutFromYaml::default()), } } @@ -362,7 +362,7 @@ impl LayoutFromYaml { match layout_dir { Some(dir) => { Self::new(&dir.join(layout)).or_else(|_| Self::from_default_assets(layout)) - } + }, None => Self::from_default_assets(layout), } } @@ -518,8 +518,8 @@ impl Layout { match part.run { Some(Run::Command(_)) | None => { total_panes += part.total_terminal_panes(); - } - Some(Run::Plugin(_)) => {} + }, + Some(Run::Plugin(_)) => {}, } } total_panes @@ -624,7 +624,7 @@ fn split_space(space_to_split: &PaneGeom, layout: &Layout) -> Vec<(Layout, PaneG panic!("Implicit sizing within fixed-size panes is not supported"); }; Dimension::percent(free_percent / flex_parts as f64) - } + }, }; inherited_dimension.set_inner( layout @@ -682,7 +682,7 @@ impl TryFrom<Url> for RunPluginLocation { Err(_) => Err(PluginsConfigError::InvalidPluginLocation(path.to_owned())), }) .map(Self::File) - } + }, _ => Err(PluginsConfigError::InvalidUrl(url)), } } diff --git a/zellij-utils/src/input/mod.rs b/zellij-utils/src/input/mod.rs index 0d51f4f5d..ed88b62d1 100644 --- a/zellij-utils/src/input/mod.rs +++ b/zellij-utils/src/input/mod.rs @@ -118,7 +118,7 @@ pub fn cast_termwiz_key(event: KeyEvent, raw_bytes: &[u8]) -> Key { } else { Key::Char(c) } - } + }, KeyCode::Backspace => Key::Backspace, KeyCode::LeftArrow | KeyCode::ApplicationLeftArrow => { if modifiers.contains(Modifiers::ALT) { @@ -126,14 +126,14 @@ pub fn cast_termwiz_key(event: KeyEvent, raw_bytes: &[u8]) -> Key { } else { Key::Left } - } + }, KeyCode::RightArrow | KeyCode::ApplicationRightArrow => { if modifiers.contains(Modifiers::ALT) { Key::Alt(CharOrArrow::Direction(Direction::Right)) } else { Key::Right } - } + }, KeyCode::UpArrow | KeyCode::ApplicationUpArrow => { if modifiers.contains(Modifiers::ALT) { //Key::AltPlusUpArrow @@ -141,14 +141,14 @@ pub fn cast_termwiz_key(event: KeyEvent, raw_bytes: &[u8]) -> Key { } else { Key::Up } - } + }, KeyCode::DownArrow | KeyCode::ApplicationDownArrow => { if modifiers.contains(Modifiers::ALT) { Key::Alt(CharOrArrow::Direction(Direction::Down)) } else { Key::Down } - } + }, KeyCode::Home => Key::Home, KeyCode::End => Key::End, KeyCode::PageUp => Key::PageUp, diff --git a/zellij-utils/src/input/plugins.rs b/zellij-utils/src/input/plugins.rs index 5d169849c..fba3c531c 100644 --- a/zellij-utils/src/input/plugins.rs +++ b/zellij-utils/src/input/plugins.rs @@ -146,8 +146,8 @@ impl PluginConfig { match self.run { PluginType::Pane(..) => { self.run = PluginType::Pane(Some(tab_index)); - } - PluginType::Headless => {} + }, + PluginType::Headless => {}, } } } diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs index ea6b4039c..a07a67851 100644 --- a/zellij-utils/src/ipc.rs +++ b/zellij-utils/src/ipc.rs @@ -193,7 +193,7 @@ where Err(e) => { warn!("Error in IpcReceiver.recv(): {:?}", e); None - } + }, } } diff --git a/zellij-utils/src/setup.rs b/zellij-utils/src/setup.rs index f5d149616..ab0509832 100644 --- a/zellij-utils/src/setup.rs +++ b/zellij-utils/src/setup.rs @@ -218,7 +218,7 @@ impl Setup { Ok(config) => config, Err(e) => { return Err(e); - } + }, } } else { Config::default() @@ -241,7 +241,7 @@ impl Setup { Some(Ok(layout)) => Some(layout), Some(Err(e)) => { return Err(e); - } + }, }; if let Some(Command::Setup(ref setup)) = &opts.command { @@ -431,20 +431,20 @@ impl Setup { _ => { eprintln!("Unsupported shell: {}", shell); std::process::exit(1); - } + }, }; let mut out = std::io::stdout(); clap_complete::generate(shell, &mut CliArgs::command(), "zellij", &mut out); // add shell dependent extra completion match shell { - Shell::Bash => {} - Shell::Elvish => {} + Shell::Bash => {}, + Shell::Elvish => {}, Shell::Fish => { let _ = out.write_all(FISH_EXTRA_COMPLETION); - } - Shell::PowerShell => {} - Shell::Zsh => {} - _ => {} + }, + Shell::PowerShell => {}, + Shell::Zsh => {}, + _ => {}, }; } @@ -454,21 +454,21 @@ impl Setup { _ => { eprintln!("Unsupported shell: {}", shell); std::process::exit(1); - } + }, }; let mut out = std::io::stdout(); match shell { Shell::Bash => { let _ = out.write_all(BASH_AUTO_START_SCRIPT); - } + }, Shell::Fish => { let _ = out.write_all(FISH_AUTO_START_SCRIPT); - } + }, Shell::Zsh => { let _ = out.write_all(ZSH_AUTO_START_SCRIPT); - } - _ => {} + }, + _ => {}, } } } diff --git a/zellij-utils/src/shared.rs b/zellij-utils/src/shared.rs index 0f9756823..6df753daf 100644 --- a/zellij-utils/src/shared.rs +++ b/zellij-utils/src/shared.rs @@ -112,7 +112,7 @@ pub fn detect_theme_hue(bg: PaletteColor) -> ThemeHue { true => ThemeHue::Light, false => ThemeHue::Dark, } - } + }, _ => ThemeHue::Dark, } } |