Skip to content

Commit 109abdd

Browse files
geoffw0paldepind
andauthored
Apply suggestions from code review
Co-authored-by: Simon Friis Vindum <[email protected]>
1 parent 4b21223 commit 109abdd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/**
2-
* @name Empty 'if' statement
3-
* @description Finds 'if' statements where the "then" branch is empty and no
2+
* @name Empty 'if' expression
3+
* @description Finds 'if' expressions where the "then" branch is empty and no
44
* "else" branch exists.
55
* @id rust/examples/empty-if
66
* @tags example
77
*/
88

99
import rust
1010

11-
// find 'if' statements...
11+
// find 'if' expressions...
1212
from IfExpr ifExpr
1313
where
1414
// where the 'then' branch is empty
1515
ifExpr.getThen().getStmtList().getNumberOfStmtOrExpr() = 0 and
1616
// and no 'else' branch exists
17-
not exists(ifExpr.getElse())
17+
not ifExpr.hasElse()
1818
select ifExpr, "This 'if' expression is redundant."

0 commit comments

Comments
 (0)