diff options
| author | bors <bors@rust-lang.org> | 2024-11-01 19:45:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-01 19:45:24 +0000 |
| commit | 9d03956fad025ab06da72eae031033b65010896f (patch) | |
| tree | a24fd95162b2eabde554b9b6a62c579c5abdf848 | |
| parent | e4dc892ae31aad96f096606b122d1ea30c48c9ca (diff) | |
| parent | a7aa8bfde0cacf3356b26f5b9af1814fa12fe3b9 (diff) | |
Auto merge of #13635 - Alexendoo:cargo-dev-serve-watch-test, r=blyxyas
Watch `tests/compile-test.rs` in `cargo dev serve` Changes to `compile-test.rs` will also need a rerun of `collect-metadata` changelog: none
| -rw-r--r-- | clippy_dev/src/serve.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clippy_dev/src/serve.rs b/clippy_dev/src/serve.rs index d367fefec61..a2d1236629f 100644 --- a/clippy_dev/src/serve.rs +++ b/clippy_dev/src/serve.rs @@ -20,8 +20,14 @@ pub fn run(port: u16, lint: Option<String>) -> ! { loop { let index_time = mtime("util/gh-pages/index.html"); + let times = [ + "clippy_lints/src", + "util/gh-pages/index_template.html", + "tests/compile-test.rs", + ] + .map(mtime); - if index_time < mtime("clippy_lints/src") || index_time < mtime("util/gh-pages/index_template.html") { + if times.iter().any(|&time| index_time < time) { Command::new(env::var("CARGO").unwrap_or("cargo".into())) .arg("collect-metadata") .spawn() |
