@@ -6,7 +6,7 @@ use super::mystd::os::unix::ffi::OsStrExt;
6
6
use super :: mystd:: path:: { Path , PathBuf } ;
7
7
use super :: Either ;
8
8
use super :: { gimli, Context , Endian , EndianSlice , Mapping , Stash } ;
9
- use alloc:: str :: String ;
9
+ use alloc:: string :: String ;
10
10
use alloc:: sync:: Arc ;
11
11
use alloc:: vec:: Vec ;
12
12
use core:: convert:: { TryFrom , TryInto } ;
@@ -422,8 +422,8 @@ fn debug_path_exists() -> bool {
422
422
/// The format of build id paths is documented at:
423
423
/// https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
424
424
fn locate_build_id ( build_id : & [ u8 ] ) -> Option < PathBuf > {
425
- const BUILD_ID_PATH : & [ u8 ] = b "/usr/lib/debug/.build-id/";
426
- const BUILD_ID_SUFFIX : & [ u8 ] = b ".debug";
425
+ const BUILD_ID_PATH : & str = "/usr/lib/debug/.build-id/" ;
426
+ const BUILD_ID_SUFFIX : & str = ".debug" ;
427
427
428
428
if build_id. len ( ) < 2 {
429
429
return None ;
@@ -435,15 +435,15 @@ fn locate_build_id(build_id: &[u8]) -> Option<PathBuf> {
435
435
436
436
let mut path =
437
437
String :: with_capacity ( BUILD_ID_PATH . len ( ) + BUILD_ID_SUFFIX . len ( ) + build_id. len ( ) * 2 + 1 ) ;
438
- path. extend ( BUILD_ID_PATH ) ;
438
+ path. push_str ( BUILD_ID_PATH ) ;
439
439
path. push ( char:: from_digit ( ( build_id[ 0 ] >> 4 ) as u32 , 16 ) ?) ;
440
440
path. push ( char:: from_digit ( ( build_id[ 0 ] & 0xf ) as u32 , 16 ) ?) ;
441
441
path. push ( '/' ) ;
442
442
for byte in & build_id[ 1 ..] {
443
443
path. push ( char:: from_digit ( ( byte >> 4 ) as u32 , 16 ) ?) ;
444
444
path. push ( char:: from_digit ( ( byte & 0xf ) as u32 , 16 ) ?) ;
445
445
}
446
- path. extend ( BUILD_ID_SUFFIX ) ;
446
+ path. push_str ( BUILD_ID_SUFFIX ) ;
447
447
Some ( PathBuf :: from ( path) )
448
448
}
449
449
0 commit comments