@@ -70,16 +70,19 @@ impl<'de> Deserialize<'de> for DebuginfoLevel {
7070 use serde:: de:: Error ;
7171
7272 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 ,
7780 StringOrInt :: Int ( n) => {
7881 let other = serde:: de:: Unexpected :: Signed ( n) ;
7982 return Err ( D :: Error :: invalid_value ( other, & "expected 0, 1, or 2" ) ) ;
8083 }
8184 StringOrInt :: String ( s) => {
82- let other = serde:: de:: Unexpected :: Str ( s) ;
85+ let other = serde:: de:: Unexpected :: Str ( & s) ;
8386 return Err ( D :: Error :: invalid_value (
8487 other,
8588 & "expected none, line-tables-only, limited, or full" ,
@@ -1021,8 +1024,8 @@ impl RustOptimize {
10211024
10221025#[ derive( Deserialize ) ]
10231026#[ serde( untagged) ]
1024- enum StringOrInt < ' a > {
1025- String ( & ' a str ) ,
1027+ enum StringOrInt {
1028+ String ( String ) ,
10261029 Int ( i64 ) ,
10271030}
10281031
0 commit comments