cargo-clean --- Remove generated artifacts
cargo clean
[options]
Remove artifacts from the target directory that Cargo has generated in the past.
With no options, cargo clean
will delete the entire target directory.
When no packages are selected, all packages and all dependencies in the workspace are cleaned.
See the reference for details on environment variables that Cargo reads.
0
: Cargo succeeded.101
: Cargo failed to complete.Remove the entire target directory:
cargo clean
Remove only the release artifacts:
cargo clean --release