@@ -67,7 +67,7 @@ pub(crate) use self::context::*;
6767pub ( crate ) use self :: span_map:: { LinkFromSrc , collect_spans_and_sources} ;
6868pub ( crate ) use self :: write_shared:: * ;
6969use crate :: clean:: { self , ItemId , RenderedLink } ;
70- use crate :: display:: { Joined as _, MaybeDisplay as _} ;
70+ use crate :: display:: { Joined as _, MaybeDisplay as _, fmt_json } ;
7171use crate :: error:: Error ;
7272use crate :: formats:: Impl ;
7373use crate :: formats:: cache:: Cache ;
@@ -1730,10 +1730,14 @@ fn notable_traits_decl(ty: &clean::Type, cx: &Context<'_>) -> (String, String) {
17301730 ( format ! ( "{:#}" , print_type( ty, cx) ) , out)
17311731}
17321732
1733- fn notable_traits_json < ' a > ( tys : impl Iterator < Item = & ' a clean:: Type > , cx : & Context < ' _ > ) -> String {
1733+ fn notable_traits_json < ' a > (
1734+ f : & mut fmt:: Formatter < ' _ > ,
1735+ tys : impl Iterator < Item = & ' a clean:: Type > ,
1736+ cx : & Context < ' _ > ,
1737+ ) {
17341738 let mut mp = tys. map ( |ty| notable_traits_decl ( ty, cx) ) . collect :: < IndexMap < _ , _ > > ( ) ;
17351739 mp. sort_unstable_keys ( ) ;
1736- serde_json :: to_string ( & mp) . expect ( "serialize (string, string) -> json object cannot fail" )
1740+ fmt_json ( f , & mp) . expect ( "serialize (string, string) -> json object cannot fail" ) ;
17371741}
17381742
17391743#[ derive( Clone , Copy , Debug ) ]
0 commit comments