Skip to content

Commit 81b426c

Browse files
committed
Improve cognitive_complexity lint's warning.
Adds the value of complexity limit set for the lint to the warning. Fixes #4466 Signed-off-by: Victor Polevoy <fx@thefx.co>
1 parent 4c8a941 commit 81b426c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/cognitive_complexity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl CognitiveComplexity {
100100
cx,
101101
COGNITIVE_COMPLEXITY,
102102
span,
103-
&format!("the function has a cognitive complexity of {}", rust_cc),
103+
&format!("the function has a cognitive complexity of ({}/{})", rust_cc, self.limit.limit()),
104104
"you could split it up into multiple smaller functions",
105105
);
106106
}

0 commit comments

Comments
 (0)