Crates.io | cargo-cleanup |
lib.rs | cargo-cleanup |
version | 0.1.2 |
source | src |
created_at | 2018-10-17 21:59:41.739186 |
updated_at | 2018-10-18 12:08:24.641165 |
description | Reads Cargo.lock and prints all cached package versions not mentioned inside. |
homepage | https://github.com/inejge/cargo-cleanup |
repository | https://github.com/inejge/cargo-cleanup |
max_upload_size | |
id | 91216 |
size | 18,890 |
Cargo keeps a local cache of downloaded dependencies. Over time, as dependencies are updated, this cache can grow pretty large, and full of outdated package versions which are unlikely to be used ever again. This tool can help you discover which packages are no longer needed. In the present, proof-of-concept form, only packages published on crates.io and present in the default registry are considered, and no automatic deletion is supported.
$ cargo install cargo-cleanup
Run
$ cargo cleanup
in the top-level directory of some crate. This will automatically try to use
Cargo.lock
from that directory. (Alternatively, you can specify the path of
Cargo.lock
as an argument to the command.) The program will read the names
and versions of all dependencies, then scan the Cargo unpacked crate cache
($HOME/.cargo/registry/src/*/...
) and list the packages whose names are
in the list, but versions aren't. For example, if your crate uses rand-0.3.22
and rand-0.4.3
, and the cache contains those two plus rand-0.5.5
, only
rand-0.5.5
will be listed.
This is a proof of concept. There is no automatic deletion. Packages retrieved directly from their repositories are not considered. Neither are alternative registries.
Licensed under either of:
at your option.