Skip to content

Constant ZERO should have UPPER_SNAKE_CASE name, e.g. Z_E_R_O #6487

@kawogi

Description

@kawogi

For the following code

pub const ZERO: Millis = Millis(0);

Visual Studio Code reports (attributed to rust-analyzer)

Constant `ZERO` should have UPPER_SNAKE_CASE name, e.g. `Z_E_R_O`

Using a quick fix results in

pub const Z_E_R_O: Millis = Millis(0);

which is consistent with the error message but very likely not the expected convention.

Offering

pub const Zero: Millis = Millis(0);

Correctly results in

Constant `Zero` should have UPPER_SNAKE_CASE name, e.g. `ZERO`

(which gives the above follow-up problem)

I expected ZERO to be the correct convention and rust-analyzer to not complain. Looks like some PascalCase parser went rogue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions