Skip to content

Commit 1125552

Browse files
ankddevlpil
authored andcommitted
chore: update comments of 'check_for_inefficient_empty_list_check'
1 parent 08fa3ae commit 1125552

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-core/src/type_/expression.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
18271827

18281828
/// Checks for inefficient usage of `list.length` for checking for the empty list.
18291829
///
1830-
/// If we find one of these usages, emit a warning to use `list.is_empty` instead.
1830+
/// If we find one of these usages, emit a warning to use comparison with empty list instead.
18311831
fn check_for_inefficient_empty_list_check(
18321832
&mut self,
18331833
binop: BinOp,
@@ -1869,7 +1869,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
18691869
}
18701870

18711871
// Check the kind of the empty list check so we know whether to recommend
1872-
// `list.is_empty` or `!list.is_empty` as a replacement.
1872+
// `== []` or `!= []` syntax as a replacement.
18731873
let kind = match get_empty_list_check_kind(binop, left, right) {
18741874
Some(kind) => kind,
18751875
None => return,

0 commit comments

Comments
 (0)