Skip to content

Commit 1a5d2e1

Browse files
committed
Rust: Correct a comment and autoformat.
1 parent 93836a5 commit 1a5d2e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rust/ql/src/queries/unusedentities/UnusedVariable.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DiscardVariable extends Variable {
1111
* Holds if variable `v` is unused.
1212
*/
1313
predicate isUnused(Variable v) {
14-
// variable is accessed or initialized
14+
// variable is not accessed or initialized
1515
not exists(v.getAnAccess()) and
1616
not exists(v.getInitializer())
1717
}
@@ -22,7 +22,8 @@ predicate isUnused(Variable v) {
2222
*/
2323
predicate isAllowableUnused(Variable v) {
2424
// in a macro expansion
25-
v.getPat().isInMacroExpansion() or
25+
v.getPat().isInMacroExpansion()
26+
or
2627
// function pointer parameters
2728
exists(FnPtrType fp | fp.getParamList().getParam(_).getPat() = v.getPat())
2829
}

0 commit comments

Comments
 (0)