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:
parent
92352f97ad
commit
1e6cefaa56
24 changed files with 46 additions and 46 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 {:?}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue