@@ -12,9 +12,10 @@ use crate::core::build_steps::clippy::get_clippy_rules_in_order;
1212use crate :: core:: config:: { LldMode , Target , TargetSelection , TomlConfig } ;
1313
1414fn 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+ )
1819}
1920
2021#[ test]
@@ -108,7 +109,7 @@ fn clap_verify() {
108109#[ test]
109110fn override_toml ( ) {
110111 let config = Config :: parse_inner (
111- & [
112+ Flags :: parse ( & [
112113 "check" . to_owned ( ) ,
113114 "--config=/does/not/exist" . to_owned ( ) ,
114115 "--set=change-id=1" . to_owned ( ) ,
@@ -121,7 +122,7 @@ fn override_toml() {
121122 "--set=target.x86_64-unknown-linux-gnu.rpath=false" . to_owned ( ) ,
122123 "--set=target.aarch64-unknown-linux-gnu.sanitizers=false" . to_owned ( ) ,
123124 "--set=target.aarch64-apple-darwin.runner=apple" . to_owned ( ) ,
124- ] ,
125+ ] ) ,
125126 |& _| {
126127 toml:: from_str (
127128 r#"
@@ -201,12 +202,12 @@ runner = "x86_64-runner"
201202#[ should_panic]
202203fn override_toml_duplicate ( ) {
203204 Config :: parse_inner (
204- & [
205+ Flags :: parse ( & [
205206 "check" . to_owned ( ) ,
206207 "--config=/does/not/exist" . to_string ( ) ,
207208 "--set=change-id=1" . to_owned ( ) ,
208209 "--set=change-id=2" . to_owned ( ) ,
209- ] ,
210+ ] ) ,
210211 |& _| toml:: from_str ( "change-id = 0" ) . unwrap ( ) ,
211212 ) ;
212213}
@@ -226,7 +227,7 @@ fn profile_user_dist() {
226227 . and_then ( |table : toml:: Value | TomlConfig :: deserialize ( table) )
227228 . unwrap ( )
228229 }
229- Config :: parse_inner ( & [ "check" . to_owned ( ) ] , get_toml) ;
230+ Config :: parse_inner ( Flags :: parse ( & [ "check" . to_owned ( ) ] ) , get_toml) ;
230231}
231232
232233#[ test]
@@ -301,7 +302,7 @@ fn order_of_clippy_rules() {
301302 "-Aclippy::foo1" . to_string( ) ,
302303 "-Aclippy::foo2" . to_string( ) ,
303304 ] ;
304- let config = Config :: parse ( & args) ;
305+ let config = Config :: parse ( Flags :: parse ( & args) ) ;
305306
306307 let actual = match & config. cmd {
307308 crate :: Subcommand :: Clippy { allow, deny, warn, forbid, .. } => {
0 commit comments