@@ -12,9 +12,10 @@ use crate::core::build_steps::clippy::get_clippy_rules_in_order;
12
12
use crate :: core:: config:: { LldMode , Target , TargetSelection , TomlConfig } ;
13
13
14
14
fn parse ( config : & str ) -> Config {
15
- Config :: parse_inner ( & [ "check" . to_string ( ) , "--config=/does/not/exist" . to_string ( ) ] , |& _| {
16
- toml:: from_str ( & config) . unwrap ( )
17
- } )
15
+ Config :: parse_inner (
16
+ Flags :: parse ( & [ "check" . to_string ( ) , "--config=/does/not/exist" . to_string ( ) ] ) ,
17
+ |& _| toml:: from_str ( & config) . unwrap ( ) ,
18
+ )
18
19
}
19
20
20
21
#[ test]
@@ -108,7 +109,7 @@ fn clap_verify() {
108
109
#[ test]
109
110
fn override_toml ( ) {
110
111
let config = Config :: parse_inner (
111
- & [
112
+ Flags :: parse ( & [
112
113
"check" . to_owned ( ) ,
113
114
"--config=/does/not/exist" . to_owned ( ) ,
114
115
"--set=change-id=1" . to_owned ( ) ,
@@ -121,7 +122,7 @@ fn override_toml() {
121
122
"--set=target.x86_64-unknown-linux-gnu.rpath=false" . to_owned ( ) ,
122
123
"--set=target.aarch64-unknown-linux-gnu.sanitizers=false" . to_owned ( ) ,
123
124
"--set=target.aarch64-apple-darwin.runner=apple" . to_owned ( ) ,
124
- ] ,
125
+ ] ) ,
125
126
|& _| {
126
127
toml:: from_str (
127
128
r#"
@@ -201,12 +202,12 @@ runner = "x86_64-runner"
201
202
#[ should_panic]
202
203
fn override_toml_duplicate ( ) {
203
204
Config :: parse_inner (
204
- & [
205
+ Flags :: parse ( & [
205
206
"check" . to_owned ( ) ,
206
207
"--config=/does/not/exist" . to_string ( ) ,
207
208
"--set=change-id=1" . to_owned ( ) ,
208
209
"--set=change-id=2" . to_owned ( ) ,
209
- ] ,
210
+ ] ) ,
210
211
|& _| toml:: from_str ( "change-id = 0" ) . unwrap ( ) ,
211
212
) ;
212
213
}
@@ -226,7 +227,7 @@ fn profile_user_dist() {
226
227
. and_then ( |table : toml:: Value | TomlConfig :: deserialize ( table) )
227
228
. unwrap ( )
228
229
}
229
- Config :: parse_inner ( & [ "check" . to_owned ( ) ] , get_toml) ;
230
+ Config :: parse_inner ( Flags :: parse ( & [ "check" . to_owned ( ) ] ) , get_toml) ;
230
231
}
231
232
232
233
#[ test]
@@ -301,7 +302,7 @@ fn order_of_clippy_rules() {
301
302
"-Aclippy::foo1" . to_string( ) ,
302
303
"-Aclippy::foo2" . to_string( ) ,
303
304
] ;
304
- let config = Config :: parse ( & args) ;
305
+ let config = Config :: parse ( Flags :: parse ( & args) ) ;
305
306
306
307
let actual = match & config. cmd {
307
308
crate :: Subcommand :: Clippy { allow, deny, warn, forbid, .. } => {
0 commit comments