Function, parameter or local binding is not named in snake_case

ID

rust.maintainability.naming_identifier_style

Severity

info

Remediation Complexity

trivial

Remediation Risk

low

Remediation Effort

low

Resource

Naming

Language

Rust

Description

Reports a function name, a first parameter name or a let binding that contains an uppercase letter, so it does not follow the snake_case convention Rust uses for values and functions.

Rationale

Rust reserves capitalisation for types, traits and enum variants, so a capital letter in a value name misleads the reader about what the identifier is - let Config = …​ reads as a type until it does not. Mixed conventions in one codebase also make identifiers harder to recall and to grep for.

The following code illustrates the pattern detected by this rule:

// FLAGGED: Function, parameter or local binding is not named in snake_case
pub fn parseInput(raw: &str) -> usize {
    raw.len()
}

Remediation

Rename the identifier to lowercase words separated by underscores - parseInput becomes parse_input, totalCount becomes total_count. Where the name has to keep a foreign spelling, place #[allow(non_snake_case)] on the item so the exception is explicit.

Configuration

This detector does not need any configuration.

© 2026 Xygeni. All rights reserved