File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/rustc_serialize/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2320,12 +2320,12 @@ impl crate::Decoder for Decoder {
23202320 let name = match self . pop ( ) {
23212321 Json :: String ( s) => s,
23222322 Json :: Object ( mut o) => {
2323- let n = match o. remove ( & "variant" . to_owned ( ) ) {
2323+ let n = match o. remove ( "variant" ) {
23242324 Some ( Json :: String ( s) ) => s,
23252325 Some ( val) => return Err ( ExpectedError ( "String" . to_owned ( ) , val. to_string ( ) ) ) ,
23262326 None => return Err ( MissingFieldError ( "variant" . to_owned ( ) ) ) ,
23272327 } ;
2328- match o. remove ( & "fields" . to_string ( ) ) {
2328+ match o. remove ( "fields" ) {
23292329 Some ( Json :: Array ( l) ) => {
23302330 self . stack . extend ( l. into_iter ( ) . rev ( ) ) ;
23312331 }
@@ -2365,7 +2365,7 @@ impl crate::Decoder for Decoder {
23652365 {
23662366 let mut obj = expect ! ( self . pop( ) , Object ) ?;
23672367
2368- let value = match obj. remove ( & name. to_string ( ) ) {
2368+ let value = match obj. remove ( name) {
23692369 None => {
23702370 // Add a Null and try to parse it as an Option<_>
23712371 // to get None as a default value.
You can’t perform that action at this time.
0 commit comments