Fix clippy::len_zero lint style violations (#36589)

Related: #36577

Release Notes:

- N/A

---------

Signed-off-by: Umesh Yadav <git@umesh.dev>
This commit is contained in:
Umesh Yadav 2025-08-20 20:05:59 +05:30 committed by GitHub
parent 92352f97ad
commit 1e6cefaa56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 46 additions and 46 deletions

View file

@ -21030,7 +21030,7 @@ fn assert_breakpoint(
path: &Arc<Path>,
expected: Vec<(u32, Breakpoint)>,
) {
if expected.len() == 0usize {
if expected.is_empty() {
assert!(!breakpoints.contains_key(path), "{}", path.display());
} else {
let mut breakpoint = breakpoints

View file

@ -181,7 +181,7 @@ pub(crate) fn generate_auto_close_edits(
*/
{
let tag_node_name_equals = |node: &Node, name: &str| {
let is_empty = name.len() == 0;
let is_empty = name.is_empty();
if let Some(node_name) = node.named_child(TS_NODE_TAG_NAME_CHILD_INDEX) {
let range = node_name.byte_range();
return buffer.text_for_range(range).equals_str(name);
@ -207,7 +207,7 @@ pub(crate) fn generate_auto_close_edits(
cur = descendant;
}
assert!(ancestors.len() > 0);
assert!(!ancestors.is_empty());
let mut tree_root_node = open_tag;

View file

@ -420,7 +420,7 @@ impl EditorTestContext {
if expected_text == "[FOLDED]\n" {
assert!(is_folded, "excerpt {} should be folded", ix);
let is_selected = selections.iter().any(|s| s.head().excerpt_id == excerpt_id);
if expected_selections.len() > 0 {
if !expected_selections.is_empty() {
assert!(
is_selected,
"excerpt {ix} should be selected. got {:?}",