@@ -408,18 +408,17 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
408408 // "crate": { parsed crate ... },
409409 // "plugins": { output of plugins ... }
410410 // }
411- let mut json = box std:: collections:: TreeMap :: new ( ) ;
412- json. insert ( "schema" . to_string ( ) ,
413- json:: String ( SCHEMA_VERSION . to_string ( ) ) ) ;
414- let plugins_json = box res. move_iter ( )
415- . filter_map ( |opt| {
416- match opt {
417- None => None ,
418- Some ( ( string, json) ) => {
419- Some ( ( string. to_string ( ) , json) )
420- }
411+ let mut json = std:: collections:: TreeMap :: new ( ) ;
412+ json. insert ( "schema" . to_string ( ) , json:: String ( SCHEMA_VERSION . to_string ( ) ) ) ;
413+ let plugins_json = res. move_iter ( )
414+ . filter_map ( |opt| {
415+ match opt {
416+ None => None ,
417+ Some ( ( string, json) ) => {
418+ Some ( ( string. to_string ( ) , json) )
421419 }
422- } ) . collect ( ) ;
420+ }
421+ } ) . collect ( ) ;
423422
424423 // FIXME #8335: yuck, Rust -> str -> JSON round trip! No way to .encode
425424 // straight to the Rust JSON representation.
@@ -429,7 +428,7 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
429428 let mut encoder = json:: Encoder :: new ( & mut w as & mut io:: Writer ) ;
430429 krate. encode ( & mut encoder) . unwrap ( ) ;
431430 }
432- str:: from_utf8 ( w. unwrap ( ) . as_slice ( ) ) . unwrap ( ) . to_string ( )
431+ str:: from_utf8_owned ( w. unwrap ( ) ) . unwrap ( )
433432 } ;
434433 let crate_json = match json:: from_str ( crate_json_str. as_slice ( ) ) {
435434 Ok ( j) => j,
@@ -440,6 +439,5 @@ fn json_output(krate: clean::Crate, res: Vec<plugins::PluginJson> ,
440439 json. insert ( "plugins" . to_string ( ) , json:: Object ( plugins_json) ) ;
441440
442441 let mut file = try!( File :: create ( & dst) ) ;
443- try!( json:: Object ( json) . to_writer ( & mut file) ) ;
444- Ok ( ( ) )
442+ json:: Object ( json) . to_writer ( & mut file)
445443}
0 commit comments