From 94244c9e005237f1925ddfcad5f0d0f6117ae464 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 24 Nov 2023 10:32:45 -0800 Subject: [PATCH] Use CargoMetadata::no_deps Fixes #164 --- NEWS.md | 4 ++++ src/output.rs | 1 - src/workspace.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 38f5725b..936d633f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # cargo-mutants changelog +## Unreleased + +- Improved: Run `cargo metadata` with `--no-deps`, so that it doesn't download and compute dependency information, which can save time in some situations. + ## 23.11.1 - New `--in-diff FILE` option tests only mutants that are in the diff from the diff --git a/src/output.rs b/src/output.rs index 54e44183..5233d7b4 100644 --- a/src/output.rs +++ b/src/output.rs @@ -286,7 +286,6 @@ mod test { list_recursive(tmp.path()), &[ "", - "Cargo.lock", "Cargo.toml", "mutants.out", "mutants.out/caught.txt", diff --git a/src/workspace.rs b/src/workspace.rs index 4a5d15fc..e0a4a5e1 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -113,6 +113,7 @@ impl Workspace { debug!(?cargo_toml_path, ?dir, "Find root files"); check_interrupted()?; let metadata = cargo_metadata::MetadataCommand::new() + .no_deps() .manifest_path(&cargo_toml_path) .exec() .context("run cargo metadata")?;