For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/static_analysis/static_analysis_rules/rust-code-quality/function-name-min-length.md. A documentation index is available at /llms.txt.
This product is not supported for your selected Datadog site. ().

Metadata

ID: rust-code-quality/function-name-min-length

Language: Rust

Severity: Info

Category: Best Practices

Description

Function names should be descriptive of their behavior. Instead of using a very short name, always use a name that indicates what the function does.

Arguments

  • min-length: Minimum length for function names. Default: 2.

Non-Compliant Code Examples

fn a() {
    println!("Hello world!");
}

Compliant Code Examples

fn hello() {
    println!("Hello world!");
}
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Security