Skip to content

Commit a11d1f5

Browse files
committed
avoid unnecessary allocation
1 parent 677bde6 commit a11d1f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/miri.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ fn main() {
184184
// FIXME: Ideally we'd turn a bad build env into a compile-time error, but
185185
// CTFE does not seem powerful enough for that yet.
186186
if let Some(sysroot) = compile_time_sysroot() {
187-
let sysroot_flag = "--sysroot".to_string();
188-
if !rustc_args.contains(&sysroot_flag) {
187+
let sysroot_flag = "--sysroot";
188+
if !rustc_args.iter().any(|e| e == sysroot_flag) {
189189
// We need to overwrite the default that librustc would compute.
190-
rustc_args.push(sysroot_flag);
190+
rustc_args.push(sysroot_flag.to_owned());
191191
rustc_args.push(sysroot);
192192
}
193193
}

0 commit comments

Comments
 (0)