Skip to content

Change Test for Issue 14422 (Cognitive Complexity lowered through mul… #14603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/ui/cognitive_complexity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,17 @@ mod issue9300 {
}
}

#[clippy::cognitive_complexity = "2"]
#[clippy::cognitive_complexity = "1"]
mod issue14422 {
fn foo() {
//~^ cognitive_complexity
for _ in 0..10 {
println!("hello there");
}
}

fn bar() {
//~^ cognitive_complexity
for _ in 0..10 {
println!("hello there");
}
Expand Down
18 changes: 17 additions & 1 deletion tests/ui/cognitive_complexity.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,21 @@ LL | pub async fn async_method() {
|
= help: you could split it up into multiple smaller functions

error: aborting due to 20 previous errors
error: the function has a cognitive complexity of (2/1)
--> tests/ui/cognitive_complexity.rs:459:8
|
LL | fn foo() {
| ^^^
|
= help: you could split it up into multiple smaller functions

error: the function has a cognitive complexity of (2/1)
--> tests/ui/cognitive_complexity.rs:466:8
|
LL | fn bar() {
| ^^^
|
= help: you could split it up into multiple smaller functions

error: aborting due to 22 previous errors