File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,7 @@ fn blend_fg_color(fg: Color, bg: Color) -> Color {
360
360
361
361
impl Write for HighlightWriter < ' _ > {
362
362
fn write ( & mut self , buf : & [ u8 ] ) -> std:: io:: Result < usize > {
363
- let str = from_utf8 ( buf) . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e ) ) ?;
363
+ let str = from_utf8 ( buf) . map_err ( std:: io:: Error :: other ) ?;
364
364
for s in str. split_inclusive ( '\n' ) {
365
365
self . line . push_str ( s) ;
366
366
if self . line . ends_with ( '\n' ) {
@@ -377,7 +377,7 @@ impl Write for HighlightWriter<'_> {
377
377
let ops = self
378
378
. parse_state
379
379
. parse_line ( & self . line , & self . syntax_set )
380
- . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e ) ) ?;
380
+ . map_err ( std:: io:: Error :: other ) ?;
381
381
let iter = HighlightIterator :: new (
382
382
& mut self . highlight_state ,
383
383
& ops[ ..] ,
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const MAX_DATA_SECTIONS: usize = 11;
50
50
pub fn run ( args : Args ) -> Result < ( ) > {
51
51
let mut file = open_file ( & args. elf_file , true ) ?;
52
52
let data = file. map ( ) ?;
53
- if data. len ( ) >= 4 && & data[ 0 ..4 ] == ALF_MAGIC {
53
+ if data. len ( ) >= 4 && data[ 0 ..4 ] == ALF_MAGIC {
54
54
return convert_alf ( args, data) ;
55
55
}
56
56
Original file line number Diff line number Diff line change @@ -204,8 +204,7 @@ fn make_rso(
204
204
let mut rso_sections: Vec < RsoSectionHeader > =
205
205
vec ! [ RsoSectionHeader :: default ( ) /* ELF null section */ ] ;
206
206
for section in file. sections ( ) {
207
- let is_valid_section =
208
- section. name ( ) . is_ok_and ( |n| RSO_SECTION_NAMES . iter ( ) . any ( |& s| s == n) ) ;
207
+ let is_valid_section = section. name ( ) . is_ok_and ( |n| RSO_SECTION_NAMES . contains ( & n) ) ;
209
208
let section_size = section. size ( ) ;
210
209
211
210
if !is_valid_section || section_size == 0 {
@@ -321,8 +320,7 @@ fn make_rso(
321
320
let mut exported_relocations: Vec < RsoRelocation > = vec ! [ ] ;
322
321
323
322
for section in file. sections ( ) {
324
- let is_valid_section =
325
- section. name ( ) . is_ok_and ( |n| RSO_SECTION_NAMES . iter ( ) . any ( |& s| s == n) ) ;
323
+ let is_valid_section = section. name ( ) . is_ok_and ( |n| RSO_SECTION_NAMES . contains ( & n) ) ;
326
324
if !is_valid_section {
327
325
continue ;
328
326
}
You can’t perform that action at this time.
0 commit comments