Need clarification about cargo clean

When I do cargo b --release for the first time, a long list of compilation output occurs.

When I change the source code and do cargo b --release a second time the compilation is super fast with no long list output, and the changes of the source are not apparent.

To remedy this, I did a cargo clean --release and then a cargo b --release to see the full long list compilation occur, but the changes in my source still did not take effect.

Do I need to do a cargo clean without any options to clean the whole release directory to have code changes take effect for the release?

Rust has incremental compilation, which saves you from recompiling everything over and over again. You shouldn't have to clean the directory each time.
It sounds like your editor didn't actually save the changes, since nothing changed even after a clean build.

1 Like