Skip to content

RFC: cargo rm --unused #415

Closed
Closed

Description

@Xuanwo

I would like to add a new flag unused under cargo rm which will remove all unused dependences from Cargo.toml.

Any idea for that?

Activity

  1. changed the title [-]RFC: `cargo rm --used`[/-] [+]RFC: `cargo rm --unused`[/+] on Aug 10, 2020
  2. mainrs commented on Aug 16, 2020

    @mainrs

    Is there currently some way to get metadata about unused crates? Without external proper tooling I would probably classify this as quite time consuming to implement with little value gained when considering the time it took to implement.

    I know that cargo-udeps is a thing but sadly they do not provide a library API to take advantage of their code analysis. Maybe tapping into rustc warnings can be done (rust-lang/rust#72342).

  3. Xuanwo commented on Aug 17, 2020

    @Xuanwo
    Author

    Maybe we can use librustc_metadata directly?

  4. epage commented on Sep 1, 2022

    @epage
    Collaborator

    cargo udeps is an existing tool for doing this. Seeing as there are still caveats to how it works, I think more work should be put into that before integrating its behavior into cargo rm especially with #682

  5. added 3 commits that reference this issue on Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions