use rustc_span::{sym, BytePos};
declare_clippy_lint! {
- /// **What it does:** Checks for methods with high cognitive complexity.
+ /// ### What it does
+ /// Checks for methods with high cognitive complexity.
///
- /// **Why is this bad?** Methods of high cognitive complexity tend to be hard to
+ /// ### Why is this bad?
+ /// Methods of high cognitive complexity tend to be hard to
/// both read and maintain. Also LLVM will tend to optimize small methods better.
///
- /// **Known problems:** Sometimes it's hard to find a way to reduce the
+ /// ### Known problems
+ /// Sometimes it's hard to find a way to reduce the
/// complexity.
///
- /// **Example:** No. You'll see it when you get the warning.
+ /// ### Example
+ /// No. You'll see it when you get the warning.
pub COGNITIVE_COMPLEXITY,
nursery,
"functions that should be split up into multiple functions"
ExprKind::If(_, _, _) => {
self.cc += 1;
},
- ExprKind::Match(_, ref arms, _) => {
+ ExprKind::Match(_, arms, _) => {
if arms.len() > 1 {
self.cc += 1;
}