Skip to content

Make cargo fix remove unused imports #6278

Closed
@hirschenberger

Description

@hirschenberger

Describe the problem you are trying to solve

It would be great, if cargo fix could remove unused imports. Import handling is already tedious when using many dependencies without preludes and so it would be great it cargo could automatically remove the superfluous imports.

Describe the solution you'd like

cargo fix and all warning: unused import:... messages are gone.

Notes

Unfortunately rustc does not give a hint, how to get rid of the warning. So one could either handle the fix in cargo itself or extend rustc's warning message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions