Fix broken Cargo build caches by deleting the target directory to force a clean rebuild.
Delete the target directory to force Cargo to rebuild all artifacts from scratch. This clears corrupted or stale build caches that cause compilation failures.
rm -rf target
If you are updating the Rust toolchain version as described in ADMIN_TASKS.md, also update the version in rust-toolchain and .github/workflows/main.yml before running the command.
Cargo stores compiled code in a folder called target to speed up future builds. Sometimes this stored data gets corrupted or becomes incompatible with new code, causing errors. Deleting this folder forces Cargo to start fresh and rebuild everything correctly, just like clearing your browser cache fixes a stuck webpage.