RFC: `cargo rm --unused`
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?
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 (https://github.com/rust-lang/rust/pull/72342).
Maybe we can use librustc_metadata directly?
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 https://github.com/killercup/cargo-edit/issues/682