Fix a bunch of other low-hanging style lints (#36498)

- **Fix a bunch of low hanging style lints like unnecessary-return**
- **Fix single worktree violation**
- **And the rest**

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 21:26:17 +02:00 committed by GitHub
parent df9c2aefb1
commit 05fc0c432c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
239 changed files with 854 additions and 1015 deletions

View file

@ -653,7 +653,7 @@ impl KeymapFile {
let is_only_binding = keymap.0[index]
.bindings
.as_ref()
.map_or(true, |bindings| bindings.len() == 1);
.is_none_or(|bindings| bindings.len() == 1);
let key_path: &[&str] = if is_only_binding {
&[]
} else {
@ -703,7 +703,7 @@ impl KeymapFile {
} else if keymap.0[index]
.bindings
.as_ref()
.map_or(true, |bindings| bindings.len() == 1)
.is_none_or(|bindings| bindings.len() == 1)
{
// if we are replacing the only binding in the section,
// just update the section in place, updating the context
@ -1056,10 +1056,10 @@ mod tests {
#[track_caller]
fn parse_keystrokes(keystrokes: &str) -> Vec<Keystroke> {
return keystrokes
keystrokes
.split(' ')
.map(|s| Keystroke::parse(s).expect("Keystrokes valid"))
.collect();
.collect()
}
#[test]