@@ -4,7 +4,7 @@ use super::mystd::os::unix::ffi::OsStrExt;
44use super :: mystd:: path:: { Path , PathBuf } ;
55use super :: Either ;
66use super :: { gimli, Context , Endian , EndianSlice , Mapping , Stash } ;
7- use alloc:: str :: String ;
7+ use alloc:: string :: String ;
88use alloc:: sync:: Arc ;
99use alloc:: vec:: Vec ;
1010use core:: convert:: { TryFrom , TryInto } ;
@@ -335,8 +335,8 @@ fn debug_path_exists() -> bool {
335335/// The format of build id paths is documented at:
336336/// https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
337337fn locate_build_id ( build_id : & [ u8 ] ) -> Option < PathBuf > {
338- const BUILD_ID_PATH : & [ u8 ] = b "/usr/lib/debug/.build-id/";
339- const BUILD_ID_SUFFIX : & [ u8 ] = b ".debug";
338+ const BUILD_ID_PATH : & str = "/usr/lib/debug/.build-id/" ;
339+ const BUILD_ID_SUFFIX : & str = ".debug" ;
340340
341341 if build_id. len ( ) < 2 {
342342 return None ;
@@ -348,15 +348,15 @@ fn locate_build_id(build_id: &[u8]) -> Option<PathBuf> {
348348
349349 let mut path =
350350 String :: with_capacity ( BUILD_ID_PATH . len ( ) + BUILD_ID_SUFFIX . len ( ) + build_id. len ( ) * 2 + 1 ) ;
351- path. extend ( BUILD_ID_PATH ) ;
351+ path. push_str ( BUILD_ID_PATH ) ;
352352 path. push ( char:: from_digit ( ( build_id[ 0 ] >> 4 ) as u32 , 16 ) ?) ;
353353 path. push ( char:: from_digit ( ( build_id[ 0 ] & 0xf ) as u32 , 16 ) ?) ;
354354 path. push ( '/' ) ;
355355 for byte in & build_id[ 1 ..] {
356356 path. push ( char:: from_digit ( ( byte >> 4 ) as u32 , 16 ) ?) ;
357357 path. push ( char:: from_digit ( ( byte & 0xf ) as u32 , 16 ) ?) ;
358358 }
359- path. extend ( BUILD_ID_SUFFIX ) ;
359+ path. push_str ( BUILD_ID_SUFFIX ) ;
360360 Some ( PathBuf :: from ( path) )
361361}
362362
0 commit comments