Description
Problem
Dependencies may be left orphaned or unused in a project as it grows and changes. This can increase build times and storage requirements for developer workstations. While it is up to developers to ensure their dependencies are in order, issuing a cargo command to remove these dependencies would be beneficial.
This seems like a common enough use case among developers to integrate it with the Cargo CLI.
Proposed Solution
Implementing a prune command cargo prune --[flags]
to automatically mark unused dependencies. Some flags to consider would be a dry-run flag, dev dependencies only, and more.
Notes
Docker has a similar command docker image prune
which will remove all unused images in a local registry. docs
Npm has a similar solution. docs
There is an existing solution to this problem. github