File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ pub trait Properties {
287
287
/// `VecRpath`
288
288
fn has_runpath ( & self ) -> VecRpath ;
289
289
/// return the corresponding string from dynstrtab for a given `d_tag`
290
- fn get_dynstr_by_tag ( & self , tag : u64 ) -> Option < String > ;
290
+ fn get_dynstr_by_tag ( & self , tag : u64 ) -> Option < & str > ;
291
291
}
292
292
293
293
// readelf -s -W /lib/x86_64-linux-gnu/libc.so.6 | grep _chk
@@ -523,15 +523,15 @@ impl Properties for Elf<'_> {
523
523
}
524
524
VecRpath :: new ( vec ! [ Rpath :: None ] )
525
525
}
526
- fn get_dynstr_by_tag ( & self , tag : u64 ) -> Option < String > {
526
+ fn get_dynstr_by_tag ( & self , tag : u64 ) -> Option < & str > {
527
527
if let Some ( dynamic) = & self . dynamic {
528
528
for dynamic in & dynamic. dyns {
529
529
if dynamic. d_tag == tag {
530
530
#[ allow( clippy:: cast_possible_truncation) ]
531
531
if let Some ( name) =
532
532
self . dynstrtab . get_at ( dynamic. d_val as usize )
533
533
{
534
- return Some ( name. to_string ( ) ) ;
534
+ return Some ( name) ;
535
535
}
536
536
}
537
537
}
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ impl fmt::Display for VecRpath {
32
32
Rpath :: None => s. push ( "None" . to_string ( ) ) ,
33
33
}
34
34
}
35
- write ! ( f, "{}" , s. join( ":" ) ) ?;
36
- Ok ( ( ) )
35
+ write ! ( f, "{}" , s. join( ":" ) )
37
36
}
38
37
}
39
38
#[ cfg( feature = "color" ) ]
@@ -46,7 +45,6 @@ impl fmt::Display for VecRpath {
46
45
Rpath :: None => s. push ( "None" . green ( ) . to_string ( ) ) ,
47
46
}
48
47
}
49
- write ! ( f, "{}" , s. join( ":" ) ) ?;
50
- Ok ( ( ) )
48
+ write ! ( f, "{}" , s. join( ":" ) )
51
49
}
52
50
}
You can’t perform that action at this time.
0 commit comments