[Cargo] Clean build artifacts from installed terminal tool

I installed mdBook via:

cargo install --git https://github.com/rust-lang/mdBook.git mdbook

This triggered a Rust build process. So I assume there are artifacts somewhere. If that is true, is it possible to clean them?


From the documentation on cargo install:

If the source is crates.io or --git then by default the crate will be built in a temporary target directory. To avoid this, the target directory can be specified by setting the CARGO_TARGET_DIR environment variable to a relative path. In particular, this can be useful for caching build artifacts on continuous integration systems.

So it seems by default it cleans it up by itself if you haven't specified where you would like it to be built.

1 Like