{"repo":"bnjbvr/cargo-machete","free":true,"listed":false,"github":"https://github.com/bnjbvr/cargo-machete","clone":"git clone https://github.com/bnjbvr/cargo-machete.git","description":"Remove unused Rust dependencies with this one weird trick!","language":"Rust","stars":1352,"topics":["rust","rust-lang","cargo","cargo-subcommand"],"license":"MIT","category":"dev-tools","readme_excerpt":"cargo-machete Remove unused Rust dependencies with this one weird trick! Thanks to Diego F. Goberna for the lovely logo 🥰 Introduction cargo-machete is a Cargo tool that detects unused dependencies in Rust projects, in a fast (yet imprecise) way. See also the blog post for a detailed writeup. Installation Install cargo-machete with cargo: cargo install cargo-machete Usage Run cargo-machete in a directory that contains one or more Rust projects (using Cargo for dependency management): The return code gives an indication whether unused dependencies have been found: - 0 if machete found no unused dependencies, - 1 if it found at least one unused dependency, - 2 if there was an error during processing (in which case there's no indication whether any unused dependency was found or not). This can be used in CI situations. False positives To ignore a certain set of dependencies in a crate, add package.metadata.cargo-machete to Cargo.toml (or workspace.metadata.cargo-machete to a workspace Cargo.toml ), and specify an ignored array: For example: If there are too many false positives, consider using the --with-metadata CLI flag, which will call cargo metadata --all-features to find final dependency names, more accurate dependencies per build type, etc. ⚠ This may modify the Cargo.lock files in your projects. Renamed crates Some crates have a different import name, than their dependency name (e.g. rustls-webpki ). This triggers false positives in cargo-machete when used without the --","default_branch":null,"files":null,"tree":[],"storefront":"/r/bnjbvr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bnjbvr/cargo-machete/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}