@@ -1936,7 +1936,9 @@ impl<'a> fmt::Display for Initializer<'a> {
1936
1936
1937
1937
fn item_constant ( w : & mut fmt:: Formatter , cx : & Context , it : & clean:: Item ,
1938
1938
c : & clean:: Constant ) -> fmt:: Result {
1939
- write ! ( w, "<pre class='rust const'>{vis}const \
1939
+ write ! ( w, "<pre class='rust const'>" ) ?;
1940
+ render_attributes ( w, it) ?;
1941
+ write ! ( w, "{vis}const \
1940
1942
{name}: {typ}{init}</pre>",
1941
1943
vis = VisSpace ( & it. visibility) ,
1942
1944
name = it. name. as_ref( ) . unwrap( ) ,
@@ -1947,7 +1949,9 @@ fn item_constant(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
1947
1949
1948
1950
fn item_static ( w : & mut fmt:: Formatter , cx : & Context , it : & clean:: Item ,
1949
1951
s : & clean:: Static ) -> fmt:: Result {
1950
- write ! ( w, "<pre class='rust static'>{vis}static {mutability}\
1952
+ write ! ( w, "<pre class='rust static'>" ) ?;
1953
+ render_attributes ( w, it) ?;
1954
+ write ! ( w, "{vis}static {mutability}\
1951
1955
{name}: {typ}{init}</pre>",
1952
1956
vis = VisSpace ( & it. visibility) ,
1953
1957
mutability = MutableSpace ( s. mutability) ,
@@ -1971,7 +1975,9 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
1971
1975
AbiSpace ( f. abi) ,
1972
1976
it. name. as_ref( ) . unwrap( ) ,
1973
1977
f. generics) . len ( ) ;
1974
- write ! ( w, "<pre class='rust fn'>{vis}{constness}{unsafety}{abi}fn \
1978
+ write ! ( w, "<pre class='rust fn'>" ) ?;
1979
+ render_attributes ( w, it) ?;
1980
+ write ! ( w, "{vis}{constness}{unsafety}{abi}fn \
1975
1981
{name}{generics}{decl}{where_clause}</pre>",
1976
1982
vis = VisSpace ( & it. visibility) ,
1977
1983
constness = ConstnessSpace ( vis_constness) ,
@@ -2006,7 +2012,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
2006
2012
}
2007
2013
2008
2014
// Output the trait definition
2009
- write ! ( w, "<pre class='rust trait'>{}{}trait {}{}{}{} " ,
2015
+ write ! ( w, "<pre class='rust trait'>" ) ?;
2016
+ render_attributes ( w, it) ?;
2017
+ write ! ( w, "{}{}trait {}{}{}{} " ,
2010
2018
VisSpace ( & it. visibility) ,
2011
2019
UnsafetySpace ( t. unsafety) ,
2012
2020
it. name. as_ref( ) . unwrap( ) ,
@@ -3001,7 +3009,9 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3001
3009
fn item_typedef ( w : & mut fmt:: Formatter , cx : & Context , it : & clean:: Item ,
3002
3010
t : & clean:: Typedef ) -> fmt:: Result {
3003
3011
let indent = format ! ( "type {}{:#} " , it. name. as_ref( ) . unwrap( ) , t. generics) . len ( ) ;
3004
- write ! ( w, "<pre class='rust typedef'>type {}{}{where_clause} = {type_};</pre>" ,
3012
+ write ! ( w, "<pre class='rust typedef'>" ) ?;
3013
+ render_attributes ( w, it) ?;
3014
+ write ! ( w, "type {}{}{where_clause} = {type_};</pre>" ,
3005
3015
it. name. as_ref( ) . unwrap( ) ,
3006
3016
t. generics,
3007
3017
where_clause = WhereClause ( & t. generics, indent) ,
0 commit comments