@@ -17,10 +17,7 @@ use serde::{Deserialize, Deserializer, Serialize};
1717#[ derive( Debug , Serialize , Deserialize , PartialEq , Eq , Default ) ]
1818#[ serde( rename_all = "kebab-case" ) ]
1919pub struct CrossEnvConfig {
20- // TODO(ahuszagh) Change to an enum
2120 cargo_config : Option < CargoConfigBehavior > ,
22- complete_cargo_config : Option < bool > ,
23- ignore_cargo_config : Option < bool > ,
2421 volumes : Option < Vec < String > > ,
2522 passthrough : Option < Vec < String > > ,
2623}
@@ -356,30 +353,11 @@ impl CrossToml {
356353 }
357354
358355 /// Returns the cargo config behavior.
359- pub fn env_cargo_config ( & self , target : & Target ) -> ( Option < CargoConfigBehavior > , Option < CargoConfigBehavior > ) {
360- self . get_value (
361- target,
362- |b| b. env . cargo_config ,
363- |t| t. env . cargo_config ,
364- )
365- }
366-
367- /// Returns the whether to use the complete cargo config settings.
368- pub fn env_complete_cargo_config ( & self , target : & Target ) -> ( Option < bool > , Option < bool > ) {
369- self . get_value (
370- target,
371- |b| b. env . complete_cargo_config ,
372- |t| t. env . complete_cargo_config ,
373- )
374- }
375-
376- /// Returns the whether to ignore cargo config files.
377- pub fn env_ignore_cargo_config ( & self , target : & Target ) -> ( Option < bool > , Option < bool > ) {
378- self . get_value (
379- target,
380- |b| b. env . ignore_cargo_config ,
381- |t| t. env . ignore_cargo_config ,
382- )
356+ pub fn env_cargo_config (
357+ & self ,
358+ target : & Target ,
359+ ) -> ( Option < CargoConfigBehavior > , Option < CargoConfigBehavior > ) {
360+ self . get_value ( target, |b| b. env . cargo_config , |t| t. env . cargo_config )
383361 }
384362
385363 /// Returns the list of environment variables to pass through for `build` and `target`
@@ -582,7 +560,10 @@ mod tests {
582560 pub fn test_toml_cargo_config_behavior ( ) -> Result < ( ) > {
583561 assert_eq ! ( CargoConfigBehavior :: Normal , toml:: from_str( "\" default\" " ) ?) ;
584562 assert_eq ! ( CargoConfigBehavior :: Ignore , toml:: from_str( "\" ignore\" " ) ?) ;
585- assert_eq ! ( CargoConfigBehavior :: Complete , toml:: from_str( "\" complete\" " ) ?) ;
563+ assert_eq ! (
564+ CargoConfigBehavior :: Complete ,
565+ toml:: from_str( "\" complete\" " ) ?
566+ ) ;
586567 assert ! ( toml:: from_str:: <CargoConfigBehavior >( "\" other\" " ) . is_err( ) ) ;
587568 assert ! ( toml:: from_str:: <CargoConfigBehavior >( "true" ) . is_err( ) ) ;
588569 assert ! ( toml:: from_str:: <CargoConfigBehavior >( "0" ) . is_err( ) ) ;
@@ -610,10 +591,7 @@ mod tests {
610591 targets : HashMap :: new ( ) ,
611592 build : CrossBuildConfig {
612593 env : CrossEnvConfig {
613- // TODO(ahuszagh) Remove
614- cargo_config : None ,
615- complete_cargo_config : None ,
616- ignore_cargo_config : Some ( false ) ,
594+ cargo_config : Some ( CargoConfigBehavior :: Ignore ) ,
617595 volumes : Some ( vec ! [ s!( "VOL1_ARG" ) , s!( "VOL2_ARG" ) ] ) ,
618596 passthrough : Some ( vec ! [ s!( "VAR1" ) , s!( "VAR2" ) ] ) ,
619597 } ,
@@ -631,7 +609,7 @@ mod tests {
631609 pre-build = ["echo 'Hello World!'"]
632610
633611 [build.env]
634- ignore- cargo-config = false
612+ cargo-config = "ignore"
635613 volumes = ["VOL1_ARG", "VOL2_ARG"]
636614 passthrough = ["VAR1", "VAR2"]
637615 "# ;
@@ -652,10 +630,7 @@ mod tests {
652630 } ,
653631 CrossTargetConfig {
654632 env : CrossEnvConfig {
655- // TODO(ahuszagh) Remove
656633 cargo_config : None ,
657- complete_cargo_config : None ,
658- ignore_cargo_config : None ,
659634 passthrough : Some ( vec ! [ s!( "VAR1" ) , s!( "VAR2" ) ] ) ,
660635 volumes : Some ( vec ! [ s!( "VOL1_ARG" ) , s!( "VOL2_ARG" ) ] ) ,
661636 } ,
@@ -710,10 +685,7 @@ mod tests {
710685 pre_build : Some ( PreBuild :: Lines ( vec ! [ s!( "echo 'Hello'" ) ] ) ) ,
711686 runner : None ,
712687 env : CrossEnvConfig {
713- // TODO(ahuszagh) Remove
714688 cargo_config : None ,
715- complete_cargo_config : None ,
716- ignore_cargo_config : None ,
717689 passthrough : None ,
718690 volumes : Some ( vec ! [ s!( "VOL" ) ] ) ,
719691 } ,
@@ -724,10 +696,7 @@ mod tests {
724696 targets : target_map,
725697 build : CrossBuildConfig {
726698 env : CrossEnvConfig {
727- // TODO(ahuszagh) Remove
728- cargo_config : None ,
729- complete_cargo_config : None ,
730- ignore_cargo_config : Some ( true ) ,
699+ cargo_config : Some ( CargoConfigBehavior :: Complete ) ,
731700 volumes : None ,
732701 passthrough : Some ( vec ! [ ] ) ,
733702 } ,
@@ -745,7 +714,7 @@ mod tests {
745714 pre-build = []
746715
747716 [build.env]
748- ignore- cargo-config = true
717+ cargo-config = "complete"
749718 passthrough = []
750719
751720 [target.aarch64-unknown-linux-gnu]
@@ -787,10 +756,7 @@ mod tests {
787756 targets : HashMap :: new ( ) ,
788757 build : CrossBuildConfig {
789758 env : CrossEnvConfig {
790- // TODO(ahuszagh) Remove
791759 cargo_config : None ,
792- complete_cargo_config : None ,
793- ignore_cargo_config : None ,
794760 passthrough : None ,
795761 volumes : None ,
796762 } ,
0 commit comments