File tree 1 file changed +3
-3
lines changed
compiler/rustc_serialize/src
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 {
2320
2320
let name = match self . pop ( ) {
2321
2321
Json :: String ( s) => s,
2322
2322
Json :: Object ( mut o) => {
2323
- let n = match o. remove ( & "variant" . to_owned ( ) ) {
2323
+ let n = match o. remove ( "variant" ) {
2324
2324
Some ( Json :: String ( s) ) => s,
2325
2325
Some ( val) => return Err ( ExpectedError ( "String" . to_owned ( ) , val. to_string ( ) ) ) ,
2326
2326
None => return Err ( MissingFieldError ( "variant" . to_owned ( ) ) ) ,
2327
2327
} ;
2328
- match o. remove ( & "fields" . to_string ( ) ) {
2328
+ match o. remove ( "fields" ) {
2329
2329
Some ( Json :: Array ( l) ) => {
2330
2330
self . stack . extend ( l. into_iter ( ) . rev ( ) ) ;
2331
2331
}
@@ -2365,7 +2365,7 @@ impl crate::Decoder for Decoder {
2365
2365
{
2366
2366
let mut obj = expect ! ( self . pop( ) , Object ) ?;
2367
2367
2368
- let value = match obj. remove ( & name. to_string ( ) ) {
2368
+ let value = match obj. remove ( name) {
2369
2369
None => {
2370
2370
// Add a Null and try to parse it as an Option<_>
2371
2371
// to get None as a default value.
You can’t perform that action at this time.
0 commit comments