Skip to content

Commit dd9504e

Browse files
committed
lints: Actually skip skipped lints
Oops. Signed-off-by: Colin Walters <[email protected]>
1 parent dfaa0e9 commit dd9504e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/src/lints.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ fn lint_inner(
155155
if let Some(lint_root_type) = lint.root_type {
156156
if lint_root_type != root_type {
157157
skipped += 1;
158+
continue;
158159
}
159160
}
160161

@@ -546,14 +547,15 @@ mod tests {
546547
let mut out = Vec::new();
547548
let root_type = RootType::Running;
548549
let r = lint_inner(root, root_type, &mut out).unwrap();
549-
assert_eq!(r.passed, LINTS.len());
550+
let allbut_one = LINTS.len().checked_sub(1).unwrap();
551+
assert_eq!(r.passed, allbut_one);
550552
assert_eq!(r.fatal, 0);
551553
assert_eq!(r.skipped, 1);
552554
assert_eq!(r.warnings, 0);
553555
root.create_dir_all("var/run/foo")?;
554556
let mut out = Vec::new();
555557
let r = lint_inner(root, root_type, &mut out).unwrap();
556-
assert_eq!(r.passed, LINTS.len().checked_sub(1).unwrap());
558+
assert_eq!(r.passed, allbut_one.checked_sub(1).unwrap());
557559
assert_eq!(r.fatal, 1);
558560
assert_eq!(r.skipped, 1);
559561
assert_eq!(r.warnings, 0);

0 commit comments

Comments
 (0)