From b9e231e0d053322175c7c3fc3fb973ffaa4d8db1 Mon Sep 17 00:00:00 2001 From: Rune Tynan Date: Fri, 6 Sep 2024 18:06:49 -0700 Subject: [PATCH] Remove another unnecessary OsStr usage --- src/symbolize/gimli/elf.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/symbolize/gimli/elf.rs b/src/symbolize/gimli/elf.rs index b23b24fc..4db6be44 100644 --- a/src/symbolize/gimli/elf.rs +++ b/src/symbolize/gimli/elf.rs @@ -393,7 +393,7 @@ fn decompress_zstd(mut input: &[u8], mut output: &mut [u8]) -> Option<()> { Some(()) } -const DEBUG_PATH: &[u8] = b"/usr/lib/debug"; +const DEBUG_PATH: &str = "/usr/lib/debug"; fn debug_path_exists() -> bool { cfg_if::cfg_if! { @@ -403,7 +403,7 @@ fn debug_path_exists() -> bool { let mut exists = DEBUG_PATH_EXISTS.load(Ordering::Relaxed); if exists == 0 { - exists = if Path::new(OsStr::from_bytes(DEBUG_PATH)).is_dir() { + exists = if Path::new(DEBUG_PATH).is_dir() { 1 } else { 2 @@ -484,7 +484,7 @@ fn locate_debuglink(path: &Path, filename: &[u8]) -> Option { if debug_path_exists() { // Try "/usr/lib/debug/parent/filename" f.clear(); - f.push(OsStr::from_bytes(DEBUG_PATH)); + f.push(DEBUG_PATH); f.push(parent.strip_prefix("/").unwrap()); f.push(filename); if f.is_file() {