Skip to content

Enable clippy::enum_glob_use lint #165

Description

@tupe12334

Enable clippy::enum_glob_use

What it catches

clippy::enum_glob_use (a pedantic lint) flags glob imports of enum variants, e.g. use MyEnum::*;. It pushes code toward explicit variant references (MyEnum::Variant) or named imports instead.

Why it improves code quality

  • Readability / origin clarity — at a use site, Pending could come from anywhere; Status::Pending (or an explicit use Status::Pending) makes the source obvious.
  • Avoids name collisions — globbing two enums into scope can silently shadow or clash variant names; explicit paths prevent ambiguity.
  • Complements existing lints — this crate already denies clippy::wildcard_imports. enum_glob_use closes the matching gap for enum-variant globs, keeping the import policy consistent.

Scope

  • Enable exactly one lint: add enum_glob_use = "deny" to the [lints.clippy] table in core/Cargo.toml, matching the crate's existing incremental ratchet convention.
  • Current violations in the tree: 0 — this is a clean regression guard. cargo clippy --all-targets, cargo build, and cargo test all pass.

A PR implementing this follows.


This issue was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions