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

@ -72,7 +72,7 @@ pub fn update_value_in_json_text<'a>(
}
} else if key_path
.last()
.map_or(false, |key| preserved_keys.contains(key))
.is_some_and(|key| preserved_keys.contains(key))
|| old_value != new_value
{
let mut new_value = new_value.clone();
@ -384,7 +384,7 @@ pub fn replace_top_level_array_value_in_json_text(
remove_range.start = cursor.node().range().start_byte;
}
}
return Ok((remove_range, String::new()));
Ok((remove_range, String::new()))
} else {
let (mut replace_range, mut replace_value) =
replace_value_in_json_text(value_str, key_path, tab_size, new_value, replace_key);
@ -405,7 +405,7 @@ pub fn replace_top_level_array_value_in_json_text(
}
}
return Ok((replace_range, replace_value));
Ok((replace_range, replace_value))
}
}
@ -527,7 +527,7 @@ pub fn append_top_level_array_value_in_json_text(
let descendant_index = cursor.descendant_index();
let res = cursor.goto_first_child() && cursor.node().kind() == kind;
cursor.goto_descendant(descendant_index);
return res;
res
}
}