Watching for changes

RecipeCratesCategories
Cargo watchcat-development-tools::cargo-plugins
Cargo limitcat-development-tools::cargo-plugins

Cargo watch

cargo-watch cargo-watch-crates.io cargo-watch-github cargo-watch-lib.rs cat-development-tools cat-development-tools::cargo-plugins

cargo install cargo-watch

# Runs `cargo check` after every code change
cargo watch -x check

# Run cargo check after code changes.
# If it succeeds, it launches cargo test.
# If tests pass, it launches the application with cargo run.
cargo watch -x check -x test -x run

Cargo limit

cargo-limit cargo-limit-crates.io cargo-limit-github cargo-limit-lib.rs

cargo-limit⮳ is Cargo with less noise: warnings are skipped until errors are fixed, Neovim integration, etc.

  • errors have highest priority
  • they never appear in the middle of warnings
  • warnings are skipped by default until errors are fixed
  • external path dependencies' warnings are skipped by default
  • all messages come in reversed order by default to avoid extra scrolling
  • messages are grouped by filenames
  • number of messages can be limited
  • after encountering first error the rest of build time is limited by default
  • files can be automatically opened in your text editor on affected lines

This tool is especially useful in combination with cargo-watch.