Skip to content

Commit c7fbcf4

Browse files
committed
Test for Multiple return statements doesnt decrease cognitive complexity
1 parent da97004 commit c7fbcf4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/ui/cognitive_complexity.rs

+17
Original file line numberDiff line numberDiff line change
@@ -448,3 +448,20 @@ mod issue9300 {
448448
}
449449
}
450450
}
451+
452+
#[clippy::cognitive_complexity = "2"]
453+
mod issue14422 {
454+
fn foo() {
455+
for _ in 0..10 {
456+
println!("hello there");
457+
}
458+
}
459+
460+
fn bar() {
461+
for _ in 0..10 {
462+
println!("hello there");
463+
}
464+
return;
465+
return;
466+
}
467+
}

0 commit comments

Comments
 (0)