From 801e720342fe7b418fb0da653ce097a7298dffab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Audiger?= Date: Wed, 14 Jan 2026 21:32:20 +0100 Subject: [PATCH] chore(brioche-cc): directly gets the underlying byte view of the OsStr slice when comparing for 'sysroot' argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémy Audiger --- crates/brioche-cc/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/brioche-cc/src/main.rs b/crates/brioche-cc/src/main.rs index b108035..f188fe5 100644 --- a/crates/brioche-cc/src/main.rs +++ b/crates/brioche-cc/src/main.rs @@ -1,4 +1,4 @@ -use std::{os::unix::process::CommandExt as _, process::ExitCode}; +use std::{os::unix::ffi::OsStrExt, os::unix::process::CommandExt as _, process::ExitCode}; use eyre::{Context as _, OptionExt as _}; @@ -49,8 +49,8 @@ fn run() -> eyre::Result<()> { } let has_sysroot_arg = next_args.iter().any(|arg| { - let arg_string = arg.to_string_lossy(); - arg_string == "--sysroot" || arg_string.starts_with("--sysroot=") + let bytes = arg.as_bytes(); + bytes == b"--sysroot" || bytes.starts_with(b"--sysroot=") }); if !has_sysroot_arg {