1
1
#![ warn( clippy:: pedantic) ]
2
+ // Do not require 1.65.0
3
+ #![ allow( clippy:: manual_let_else) ]
2
4
extern crate clap;
3
5
extern crate core;
4
6
extern crate goblin;
@@ -57,19 +59,19 @@ fn print_binary_results(binaries: &Binaries, settings: &output::Settings) {
57
59
if let Ok ( colored_json) =
58
60
to_colored_json_auto ( & json ! ( binaries) )
59
61
{
60
- println ! ( "{}" , colored_json ) ;
62
+ println ! ( "{colored_json}" ) ;
61
63
}
62
64
} else if let Ok ( json_str) = to_string_pretty ( & json ! ( binaries) ) {
63
- println ! ( "{}" , json_str ) ;
65
+ println ! ( "{json_str}" ) ;
64
66
}
65
67
#[ cfg( not( feature = "color" ) ) ]
66
68
if let Ok ( json_str) = to_string_pretty ( & json ! ( binaries) ) {
67
- println ! ( "{}" , json_str ) ;
69
+ println ! ( "{json_str}" ) ;
68
70
}
69
71
}
70
72
output:: Format :: Text => {
71
73
for binary in & binaries. binaries {
72
- println ! ( "{}" , binary ) ;
74
+ println ! ( "{binary}" ) ;
73
75
}
74
76
}
75
77
}
@@ -86,14 +88,14 @@ fn print_process_results(processes: &Processes, settings: &output::Settings) {
86
88
if let Ok ( colored_json) =
87
89
to_colored_json_auto ( & json ! ( processes) )
88
90
{
89
- println ! ( "{}" , colored_json ) ;
91
+ println ! ( "{colored_json}" ) ;
90
92
}
91
93
} else if let Ok ( json_str) = to_string_pretty ( & json ! ( processes) ) {
92
- println ! ( "{}" , json_str ) ;
94
+ println ! ( "{json_str}" ) ;
93
95
}
94
96
#[ cfg( not( feature = "color" ) ) ]
95
97
if let Ok ( json_str) = to_string_pretty ( & json ! ( processes) ) {
96
- println ! ( "{}" , json_str ) ;
98
+ println ! ( "{json_str}" ) ;
97
99
}
98
100
}
99
101
output:: Format :: Text => {
@@ -118,7 +120,7 @@ fn print_process_results(processes: &Processes, settings: &output::Settings) {
118
120
if let Some ( maps) = & process. maps {
119
121
println ! ( "{:>12}" , "\u{21aa} Maps:" ) ;
120
122
for map in maps {
121
- println ! ( "\t {}" , map ) ;
123
+ println ! ( "\t {map}" ) ;
122
124
}
123
125
}
124
126
}
@@ -140,7 +142,7 @@ impl fmt::Display for ParseError {
140
142
Self :: Goblin ( e) => e. fmt ( f) ,
141
143
Self :: IO ( e) => e. fmt ( f) ,
142
144
Self :: Unimplemented ( str) => {
143
- write ! ( f, "Support for files of type {} not implemented" , str )
145
+ write ! ( f, "Support for files of type {str } not implemented" )
144
146
}
145
147
}
146
148
}
@@ -315,7 +317,7 @@ fn main() {
315
317
. requires ( "pid" )
316
318
. requires ( "process" )
317
319
. requires ( "process-all" )
318
- . conflicts_with_all ( & [ "directory" , "file" ] ) ,
320
+ . conflicts_with_all ( [ "directory" , "file" ] ) ,
319
321
)
320
322
. arg (
321
323
Arg :: new ( "no-color" )
@@ -355,7 +357,7 @@ fn main() {
355
357
)
356
358
. group (
357
359
ArgGroup :: new ( "operation" )
358
- . args ( & [ "directory" , "file" , "pid" , "process" , "process-all" ] )
360
+ . args ( [ "directory" , "file" , "pid" , "process" , "process-all" ] )
359
361
. required ( true ) ,
360
362
)
361
363
. get_matches ( ) ;
@@ -401,7 +403,7 @@ fn main() {
401
403
. map ( |id| match id. parse :: < sysinfo:: Pid > ( ) {
402
404
Ok ( id) => id,
403
405
Err ( msg) => {
404
- eprintln ! ( "Invalid process ID {}: {}" , id , msg ) ;
406
+ eprintln ! ( "Invalid process ID {id }: {msg}" ) ;
405
407
process:: exit ( 1 ) ;
406
408
}
407
409
} )
@@ -416,7 +418,7 @@ fn main() {
416
418
let process = if let Some ( process) = system. process ( procid) {
417
419
process
418
420
} else {
419
- eprintln ! ( "No process found with ID {}" , procid ) ;
421
+ eprintln ! ( "No process found with ID {procid}" ) ;
420
422
continue ;
421
423
} ;
422
424
@@ -463,7 +465,7 @@ fn main() {
463
465
}
464
466
}
465
467
if procs. is_empty ( ) {
466
- eprintln ! ( "No process found matching name {}" , procname ) ;
468
+ eprintln ! ( "No process found matching name {procname}" ) ;
467
469
process:: exit ( 1 ) ;
468
470
}
469
471
print_process_results ( & Processes :: new ( procs) , & settings) ;
0 commit comments