@@ -495,9 +495,11 @@ c = ['c']
495
495
let config = ConfigBuilder :: new ( ) . env ( "CARGO_A" , "x y" ) . build ( ) ;
496
496
assert_error (
497
497
config. get :: < VSOB > ( "a" ) . unwrap_err ( ) ,
498
- "error in environment variable `CARGO_A`: \
499
- could not load config key `a`: \
500
- invalid type: string \" x y\" , expected a boolean or vector of strings",
498
+ "\
499
+ error in environment variable `CARGO_A`: could not load config key `a`
500
+
501
+ Caused by:
502
+ invalid type: string \" x y\" , expected a boolean or vector of strings" ,
501
503
) ;
502
504
503
505
// Normal env.
@@ -570,9 +572,11 @@ opt-level = 'foo'
570
572
571
573
assert_error (
572
574
config. get :: < toml:: TomlProfile > ( "profile.dev" ) . unwrap_err ( ) ,
573
- "error in [..]/.cargo/config: \
574
- could not load config key `profile.dev.opt-level`: \
575
- must be an integer, `z`, or `s`, but found: foo",
575
+ "\
576
+ error in [..]/.cargo/config: could not load config key `profile.dev.opt-level`
577
+
578
+ Caused by:
579
+ must be an integer, `z`, or `s`, but found: foo" ,
576
580
) ;
577
581
578
582
let config = ConfigBuilder :: new ( )
@@ -581,9 +585,11 @@ opt-level = 'foo'
581
585
582
586
assert_error (
583
587
config. get :: < toml:: TomlProfile > ( "profile.dev" ) . unwrap_err ( ) ,
584
- "error in environment variable `CARGO_PROFILE_DEV_OPT_LEVEL`: \
585
- could not load config key `profile.dev.opt-level`: \
586
- must be an integer, `z`, or `s`, but found: asdf",
588
+ "\
589
+ error in environment variable `CARGO_PROFILE_DEV_OPT_LEVEL`: could not load config key `profile.dev.opt-level`
590
+
591
+ Caused by:
592
+ must be an integer, `z`, or `s`, but found: asdf" ,
587
593
) ;
588
594
}
589
595
@@ -653,8 +659,11 @@ big = 123456789
653
659
) ;
654
660
assert_error (
655
661
config. get :: < u8 > ( "S.big" ) . unwrap_err ( ) ,
656
- "error in [..].cargo/config: could not load config key `S.big`: \
657
- invalid value: integer `123456789`, expected u8",
662
+ "\
663
+ error in [..].cargo/config: could not load config key `S.big`
664
+
665
+ Caused by:
666
+ invalid value: integer `123456789`, expected u8" ,
658
667
) ;
659
668
660
669
// Environment variable type errors.
@@ -664,9 +673,11 @@ big = 123456789
664
673
) ;
665
674
assert_error (
666
675
config. get :: < i8 > ( "e.big" ) . unwrap_err ( ) ,
667
- "error in environment variable `CARGO_E_BIG`: \
668
- could not load config key `e.big`: \
669
- invalid value: integer `123456789`, expected i8",
676
+ "\
677
+ error in environment variable `CARGO_E_BIG`: could not load config key `e.big`
678
+
679
+ Caused by:
680
+ invalid value: integer `123456789`, expected i8" ,
670
681
) ;
671
682
672
683
#[ derive( Debug , Deserialize ) ]
@@ -952,27 +963,35 @@ i64max = 9223372036854775807
952
963
953
964
assert_error (
954
965
config. get :: < u32 > ( "nneg" ) . unwrap_err ( ) ,
955
- "error in [..].cargo/config: \
956
- could not load config key `nneg`: \
957
- invalid value: integer `-123456789`, expected u32",
966
+ "\
967
+ error in [..].cargo/config: could not load config key `nneg`
968
+
969
+ Caused by:
970
+ invalid value: integer `-123456789`, expected u32" ,
958
971
) ;
959
972
assert_error (
960
973
config. get :: < u32 > ( "eneg" ) . unwrap_err ( ) ,
961
- "error in environment variable `CARGO_ENEG`: \
962
- could not load config key `eneg`: \
963
- invalid value: integer `-1`, expected u32",
974
+ "\
975
+ error in environment variable `CARGO_ENEG`: could not load config key `eneg`
976
+
977
+ Caused by:
978
+ invalid value: integer `-1`, expected u32" ,
964
979
) ;
965
980
assert_error (
966
981
config. get :: < i8 > ( "npos" ) . unwrap_err ( ) ,
967
- "error in [..].cargo/config: \
968
- could not load config key `npos`: \
969
- invalid value: integer `123456789`, expected i8",
982
+ "\
983
+ error in [..].cargo/config: could not load config key `npos`
984
+
985
+ Caused by:
986
+ invalid value: integer `123456789`, expected i8" ,
970
987
) ;
971
988
assert_error (
972
989
config. get :: < i8 > ( "epos" ) . unwrap_err ( ) ,
973
- "error in environment variable `CARGO_EPOS`: \
974
- could not load config key `epos`: \
975
- invalid value: integer `123456789`, expected i8",
990
+ "\
991
+ error in environment variable `CARGO_EPOS`: could not load config key `epos`
992
+
993
+ Caused by:
994
+ invalid value: integer `123456789`, expected i8" ,
976
995
) ;
977
996
}
978
997
0 commit comments