Skip to content

Lint on pub(crate) inside private modΒ #5274

Closed
@1tgr

Description

@1tgr

pub(crate) within mod is redundant as the parent mod is not public:

mod a {
    pub(crate) fn f() { }

    // f is not accessible outside of a, so it's the same as:
    // pub fn f() { }
}

It's also redundant to re-state pub(crate):

pub(crate) mod b {
    pub(crate) fn g() { }

    // b is already crate-visible, so g is the same as:
    // pub fn g() { }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-unnecessaryLint: Warn about unnecessary codegood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions