Remove unused deps from workspace Cargo.toml
Currently, cargo-machete doesn't check if the workspace Cargo.toml contains any unused deps or not. I think it should be straightforward as you only need to deal with Cargo.toml files, although things never are.
@bnjbvr any idea on this issue?
Yep, it's not implemented; one would need to scan the set of dependencies from the workspace, and then figure out the workspace definition to navigate through all the directories it includes. Good luck :-)
Hi, is there any progress?
Nope, no one has volunteered to work on this, so feel free to take a stab and open a PR!
Removing a dependency with cargo remove will clean all unused dependencies in workspace Cargo.toml.
Removing a dependency with cargo remove will clean all unused dependencies in workspace Cargo.toml.
No I don't think so. cargo remove needs user to provide the name of dependency to remove. It cannot find unused deps.
Removing a dependency with cargo remove will clean all unused dependencies in workspace Cargo.toml.
No I don't think so.
cargo removeneeds user to provide the name of dependency to remove. It cannot find unused deps.
You can give a try. That is the side effect of removing package.
cargo-shear seems to have support for removing the dependencies from the workspace Cargo.toml, although I've not looked at how it is doing it.
Sweet, I didn't know about cargo-shear! Looks like there are a few good ideas to borrow from there…