@@ -70,16 +70,19 @@ impl<'de> Deserialize<'de> for DebuginfoLevel {
70
70
use serde:: de:: Error ;
71
71
72
72
Ok ( match Deserialize :: deserialize ( deserializer) ? {
73
- StringOrInt :: String ( "none" ) | StringOrInt :: Int ( 0 ) => DebuginfoLevel :: None ,
74
- StringOrInt :: String ( "line-tables-only" ) => DebuginfoLevel :: LineTablesOnly ,
75
- StringOrInt :: String ( "limited" ) | StringOrInt :: Int ( 1 ) => DebuginfoLevel :: Limited ,
76
- StringOrInt :: String ( "full" ) | StringOrInt :: Int ( 2 ) => DebuginfoLevel :: Full ,
73
+ StringOrInt :: String ( s) if s == "none" => DebuginfoLevel :: None ,
74
+ StringOrInt :: Int ( 0 ) => DebuginfoLevel :: None ,
75
+ StringOrInt :: String ( s) if s == "line-tables-only" => DebuginfoLevel :: LineTablesOnly ,
76
+ StringOrInt :: String ( s) if s == "limited" => DebuginfoLevel :: Limited ,
77
+ StringOrInt :: Int ( 1 ) => DebuginfoLevel :: Limited ,
78
+ StringOrInt :: String ( s) if s == "full" => DebuginfoLevel :: Full ,
79
+ StringOrInt :: Int ( 2 ) => DebuginfoLevel :: Full ,
77
80
StringOrInt :: Int ( n) => {
78
81
let other = serde:: de:: Unexpected :: Signed ( n) ;
79
82
return Err ( D :: Error :: invalid_value ( other, & "expected 0, 1, or 2" ) ) ;
80
83
}
81
84
StringOrInt :: String ( s) => {
82
- let other = serde:: de:: Unexpected :: Str ( s) ;
85
+ let other = serde:: de:: Unexpected :: Str ( & s) ;
83
86
return Err ( D :: Error :: invalid_value (
84
87
other,
85
88
& "expected none, line-tables-only, limited, or full" ,
@@ -1034,8 +1037,8 @@ impl RustOptimize {
1034
1037
1035
1038
#[ derive( Deserialize ) ]
1036
1039
#[ serde( untagged) ]
1037
- enum StringOrInt < ' a > {
1038
- String ( & ' a str ) ,
1040
+ enum StringOrInt {
1041
+ String ( String ) ,
1039
1042
Int ( i64 ) ,
1040
1043
}
1041
1044
0 commit comments