Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enum linting options are not respected #620

@styris-ame

Description

@styris-ame

Consider the following enum:

#[derive(Default, Archive, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
pub enum UserVerificationPolicy {
    Required,
    Preferred,
    Discouraged_DO_NOT_USE,
}

Without the Archive derivation, this compiles fine. Once added, the following error appears: variant 'Discouraged_DO_NOT_USE' should have an upper camel case name. The Archive macro should probably mirror allow attributes to the archived type.

Note that the project uses #![deny(warnings)] globally, hence the error instead of warning.

Workaround

Specify the allow rule file-wide, using #![allow(non_camel_case_types)]

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