Skip to content

Commit

Permalink
Use CargoMetadata::no_deps (#165)
Browse files Browse the repository at this point in the history
Sometimes `cargo metadata` spends a lot of time updating dependency
information, and we don't need it: we're only
interested in packages in the workspace.

Fixes #164
  • Loading branch information
sourcefrog authored Nov 24, 2023
2 parents 8898c07 + 94244c9 commit 61ed6ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ mod test {
list_recursive(tmp.path()),
&[
"",
"Cargo.lock",
"Cargo.toml",
"mutants.out",
"mutants.out/caught.txt",
Expand Down
1 change: 1 addition & 0 deletions src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
Expand Down

0 comments on commit 61ed6ed

Please sign in to comment.