Now, The only way I used is cargo clean and then cargo build again.
cargo clean
cargo build
You can also delete the target directory that contains all the build artifacts.
target
There's two way to have a clean compile:
Remove directory target with following command if you using Mac or Linux
rm -rf target
Cargo clean and build with following command:
cargo clean && cargo build --release
You can also delete the
target
directory that contains all the build artifacts.