Skip to content

Commit 222a0b7

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cargo-miri/bin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,14 +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")
962+
if suffix.split(',').any(|a| a == "diagnostic-rendered-ansi")
963963
{
964964
cmd.arg("--color=always");
965965
}

0 commit comments

Comments
 (0)