@@ -109,6 +109,10 @@ impl Buffer {
109109 self . buffer
110110 }
111111
112+ pub ( crate ) fn push ( & mut self , c : char ) {
113+ self . buffer . push ( c) ;
114+ }
115+
112116 pub ( crate ) fn push_str ( & mut self , s : & str ) {
113117 self . buffer . push_str ( s) ;
114118 }
@@ -451,9 +455,9 @@ impl clean::GenericBound {
451455 hir:: TraitBoundModifier :: MaybeConst => "" ,
452456 } ;
453457 if f. alternate ( ) {
454- write ! ( f, "{modifier_str}{:#}" , ty. print( cx) )
458+ write ! ( f, "{modifier_str}{ty :#}" , ty = ty. print( cx) )
455459 } else {
456- write ! ( f, "{modifier_str}{}" , ty. print( cx) )
460+ write ! ( f, "{modifier_str}{ty }" , ty = ty. print( cx) )
457461 }
458462 }
459463 } )
@@ -631,14 +635,14 @@ fn generate_macro_def_id_path(
631635 let url = match cache. extern_locations [ & def_id. krate ] {
632636 ExternalLocation :: Remote ( ref s) => {
633637 // `ExternalLocation::Remote` always end with a `/`.
634- format ! ( "{s}{}" , path. iter( ) . map( |p| p. as_str( ) ) . join( "/" ) )
638+ format ! ( "{s}{path }" , path = path. iter( ) . map( |p| p. as_str( ) ) . join( "/" ) )
635639 }
636640 ExternalLocation :: Local => {
637641 // `root_path` always end with a `/`.
638642 format ! (
639- "{}{crate_name}/{}" ,
640- root_path. unwrap_or( "" ) ,
641- path. iter( ) . map( |p| p. as_str( ) ) . join( "/" )
643+ "{root_path }{crate_name}/{path }" ,
644+ root_path = root_path . unwrap_or( "" ) ,
645+ path = path . iter( ) . map( |p| p. as_str( ) ) . join( "/" )
642646 )
643647 }
644648 ExternalLocation :: Unknown => {
@@ -827,17 +831,17 @@ fn resolved_path<'cx>(
827831 let path = if use_absolute {
828832 if let Ok ( ( _, _, fqp) ) = href ( did, cx) {
829833 format ! (
830- "{}::{}" ,
831- join_with_double_colon( & fqp[ ..fqp. len( ) - 1 ] ) ,
832- anchor( did, * fqp. last( ) . unwrap( ) , cx)
834+ "{path }::{anchor }" ,
835+ path = join_with_double_colon( & fqp[ ..fqp. len( ) - 1 ] ) ,
836+ anchor = anchor ( did, * fqp. last( ) . unwrap( ) , cx)
833837 )
834838 } else {
835839 last. name . to_string ( )
836840 }
837841 } else {
838842 anchor ( did, last. name , cx) . to_string ( )
839843 } ;
840- write ! ( w, "{path}{}" , last. args. print( cx) ) ?;
844+ write ! ( w, "{path}{args }" , args = last. args. print( cx) ) ?;
841845 }
842846 Ok ( ( ) )
843847}
@@ -945,8 +949,8 @@ pub(crate) fn anchor<'a, 'cx: 'a>(
945949 if let Ok ( ( url, short_ty, fqp) ) = parts {
946950 write ! (
947951 f,
948- r#"<a class="{short_ty}" href="{url}" title="{short_ty} {}">{text}</a>"# ,
949- join_with_double_colon( & fqp) ,
952+ r#"<a class="{short_ty}" href="{url}" title="{short_ty} {path }">{text}</a>"# ,
953+ path = join_with_double_colon( & fqp) ,
950954 )
951955 } else {
952956 f. write_str ( text. as_str ( ) )
@@ -1080,9 +1084,9 @@ fn fmt_type<'cx>(
10801084
10811085 if matches ! ( * * t, clean:: Generic ( _) ) || t. is_assoc_ty ( ) {
10821086 let text = if f. alternate ( ) {
1083- format ! ( "*{m} {:#}" , t. print( cx) )
1087+ format ! ( "*{m} {ty :#}" , ty = t. print( cx) )
10841088 } else {
1085- format ! ( "*{m} {}" , t. print( cx) )
1089+ format ! ( "*{m} {ty }" , ty = t. print( cx) )
10861090 } ;
10871091 primitive_link ( f, clean:: PrimitiveType :: RawPointer , & text, cx)
10881092 } else {
@@ -1440,11 +1444,20 @@ impl clean::FnDecl {
14401444 clean:: SelfValue => {
14411445 write ! ( f, "self" ) ?;
14421446 }
1443- clean:: SelfBorrowed ( Some ( ref lt) , mtbl) => {
1444- write ! ( f, "{amp}{} {}self" , lt. print( ) , mtbl. print_with_space( ) ) ?;
1447+ clean:: SelfBorrowed ( Some ( ref lt) , mutability) => {
1448+ write ! (
1449+ f,
1450+ "{amp}{lifetime} {mutability}self" ,
1451+ lifetime = lt. print( ) ,
1452+ mutability = mutability. print_with_space( ) ,
1453+ ) ?;
14451454 }
1446- clean:: SelfBorrowed ( None , mtbl) => {
1447- write ! ( f, "{amp}{}self" , mtbl. print_with_space( ) ) ?;
1455+ clean:: SelfBorrowed ( None , mutability) => {
1456+ write ! (
1457+ f,
1458+ "{amp}{mutability}self" ,
1459+ mutability = mutability. print_with_space( ) ,
1460+ ) ?;
14481461 }
14491462 clean:: SelfExplicit ( ref typ) => {
14501463 write ! ( f, "self: " ) ?;
@@ -1627,7 +1640,7 @@ impl clean::Import {
16271640 if name == self . source . path . last ( ) {
16281641 write ! ( f, "use {};" , self . source. print( cx) )
16291642 } else {
1630- write ! ( f, "use {} as {name};" , self . source. print( cx) )
1643+ write ! ( f, "use {source } as {name};" , source = self . source. print( cx) )
16311644 }
16321645 }
16331646 clean:: ImportKind :: Glob => {
0 commit comments