@@ -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" ,
@@ -1021,8 +1024,8 @@ impl RustOptimize {
1021
1024
1022
1025
#[ derive( Deserialize ) ]
1023
1026
#[ serde( untagged) ]
1024
- enum StringOrInt < ' a > {
1025
- String ( & ' a str ) ,
1027
+ enum StringOrInt {
1028
+ String ( String ) ,
1026
1029
Int ( i64 ) ,
1027
1030
}
1028
1031
0 commit comments