Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fed0e16

Browse files
committed
don't assert the same thing twice
1 parent da6a780 commit fed0e16

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cargo-miri/bin.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,15 +952,14 @@ fn phase_runner(binary: &Path, binary_args: env::Args, phase: RunnerPhase) {
952952
assert!(suffix.starts_with('='));
953953
// Drop this argument.
954954
} else if let Some(suffix) = arg.strip_prefix(json_flag) {
955-
assert!(suffix.starts_with('='));
955+
let suffix = suffix.strip_prefix('=').unwrap();
956956
// This is how we pass through --color=always. We detect that Cargo is detecting rustc
957957
// to emit the diagnostic structure that Cargo would consume from rustc to emit colored
958958
// diagnostics, and ask rustc to emit them.
959959
// See https://github.com/rust-lang/miri/issues/2037
960960
// First skip over the leading `=`, then check for diagnostic-rendered-ansi in the
961961
// comma-separated list
962-
if suffix.strip_prefix('=').unwrap().split(',').any(|a| a == "diagnostic-rendered-ansi")
963-
{
962+
if suffix.split(',').any(|a| a == "diagnostic-rendered-ansi") {
964963
cmd.arg("--color=always");
965964
}
966965
// But aside from remembering that colored output was requested, drop this argument.

0 commit comments

Comments
 (0)