cargo-cleanup

Crates.iocargo-cleanup
lib.rscargo-cleanup
version0.1.2
sourcesrc
created_at2018-10-17 21:59:41.739186
updated_at2018-10-18 12:08:24.641165
descriptionReads Cargo.lock and prints all cached package versions not mentioned inside.
homepagehttps://github.com/inejge/cargo-cleanup
repositoryhttps://github.com/inejge/cargo-cleanup
max_upload_size
id91216
size18,890
(inejge)

documentation

https://github.com/inejge/cargo-cleanup/blob/master/README.md

README

Cached package cleanup for Cargo

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.

Installation

$ cargo install cargo-cleanup

Usage

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.

Caveat

This is a proof of concept. There is no automatic deletion. Packages retrieved directly from their repositories are not considered. Neither are alternative registries.

License

Licensed under either of:

at your option.

Commit count: 5

cargo fmt