RS.CLIPPY.TOO_MANY_LINES

Functions with too many lines

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: too_many_lines. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for functions with a large amount of lines.

Why is this bad?

Functions with a lot of lines are harder to understand due to having to look at a larger amount of code to understand what the function is doing. Consider splitting the body of the function into multiple functions.

Example

fn im_too_long() {
    println!("");
    // ... 100 more LoC
    println!("");
}

Configuration

  • too-many-lines-threshold: The maximum number of lines a function or method can have

    (default: 100)