From a11d1f55ff14d7a1708f51e21771c8eb7bf44102 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 13 Jul 2019 15:18:15 +0200 Subject: [PATCH] avoid unnecessary allocation --- src/bin/miri.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/miri.rs b/src/bin/miri.rs index 0f28a0c5d8dc..6e67246d2ca1 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -184,10 +184,10 @@ fn main() { // FIXME: Ideally we'd turn a bad build env into a compile-time error, but // CTFE does not seem powerful enough for that yet. if let Some(sysroot) = compile_time_sysroot() { - let sysroot_flag = "--sysroot".to_string(); - if !rustc_args.contains(&sysroot_flag) { + let sysroot_flag = "--sysroot"; + if !rustc_args.iter().any(|e| e == sysroot_flag) { // We need to overwrite the default that librustc would compute. - rustc_args.push(sysroot_flag); + rustc_args.push(sysroot_flag.to_owned()); rustc_args.push(sysroot); } }