@@ -4,7 +4,7 @@ use super::mystd::os::unix::ffi::OsStrExt;
4
4
use super :: mystd:: path:: { Path , PathBuf } ;
5
5
use super :: Either ;
6
6
use super :: { gimli, Context , Endian , EndianSlice , Mapping , Stash } ;
7
- use alloc:: str :: String ;
7
+ use alloc:: string :: String ;
8
8
use alloc:: sync:: Arc ;
9
9
use alloc:: vec:: Vec ;
10
10
use core:: convert:: { TryFrom , TryInto } ;
@@ -335,8 +335,8 @@ fn debug_path_exists() -> bool {
335
335
/// The format of build id paths is documented at:
336
336
/// https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
337
337
fn 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" ;
340
340
341
341
if build_id. len ( ) < 2 {
342
342
return None ;
@@ -348,15 +348,15 @@ fn locate_build_id(build_id: &[u8]) -> Option<PathBuf> {
348
348
349
349
let mut path =
350
350
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 ) ;
352
352
path. push ( char:: from_digit ( ( build_id[ 0 ] >> 4 ) as u32 , 16 ) ?) ;
353
353
path. push ( char:: from_digit ( ( build_id[ 0 ] & 0xf ) as u32 , 16 ) ?) ;
354
354
path. push ( '/' ) ;
355
355
for byte in & build_id[ 1 ..] {
356
356
path. push ( char:: from_digit ( ( byte >> 4 ) as u32 , 16 ) ?) ;
357
357
path. push ( char:: from_digit ( ( byte & 0xf ) as u32 , 16 ) ?) ;
358
358
}
359
- path. extend ( BUILD_ID_SUFFIX ) ;
359
+ path. push_str ( BUILD_ID_SUFFIX ) ;
360
360
Some ( PathBuf :: from ( path) )
361
361
}
362
362
0 commit comments