From cfd94f5f76ef2a8bca558342d66a5bb3b3d581df 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 a895fe45..074d4256 100644 --- a/src/symbolize/gimli/elf.rs +++ b/src/symbolize/gimli/elf.rs @@ -306,7 +306,7 @@ fn decompress_zlib(input: &[u8], output: &mut [u8]) -> Option<()> { } } -const DEBUG_PATH: &[u8] = b"/usr/lib/debug"; +const DEBUG_PATH: &str = "/usr/lib/debug"; fn debug_path_exists() -> bool { cfg_if::cfg_if! { @@ -316,7 +316,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 @@ -397,7 +397,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() {