diff options
| author | cerdelen <cedric.erdelen@gmail.com> | 2025-04-11 09:30:28 +0200 |
|---|---|---|
| committer | cerdelen <cedric.erdelen@gmail.com> | 2025-04-11 09:30:28 +0200 |
| commit | c7fbcf4c339aa2162ed42d7beea1e927c2cd6c0e (patch) | |
| tree | 5335e30e23ee58ee1f3fc03997d511ae6ede30d8 | |
| parent | da97004e7217f88f40c39998e8406ceb383a9243 (diff) | |
| download | rust-c7fbcf4c339aa2162ed42d7beea1e927c2cd6c0e.tar.gz rust-c7fbcf4c339aa2162ed42d7beea1e927c2cd6c0e.zip | |
Test for Multiple return statements doesnt decrease cognitive complexity
| -rw-r--r-- | tests/ui/cognitive_complexity.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/cognitive_complexity.rs b/tests/ui/cognitive_complexity.rs index 2dbec955f63..88033a7b674 100644 --- a/tests/ui/cognitive_complexity.rs +++ b/tests/ui/cognitive_complexity.rs @@ -448,3 +448,20 @@ mod issue9300 { } } } + +#[clippy::cognitive_complexity = "2"] +mod issue14422 { + fn foo() { + for _ in 0..10 { + println!("hello there"); + } + } + + fn bar() { + for _ in 0..10 { + println!("hello there"); + } + return; + return; + } +} |
