@@ -89,7 +89,7 @@ crate type NameDoc = (String, Option<String>);
89
89
90
90
crate fn ensure_trailing_slash ( v : & str ) -> impl fmt:: Display + ' _ {
91
91
crate :: html:: format:: display_fn ( move |f| {
92
- if !v. ends_with ( '/' ) && !v. is_empty ( ) { write ! ( f, "{}/" , v) } else { write ! ( f , "{}" , v) }
92
+ if !v. ends_with ( '/' ) && !v. is_empty ( ) { write ! ( f, "{}/" , v) } else { f . write_str ( v) }
93
93
} )
94
94
}
95
95
@@ -904,12 +904,13 @@ themePicker.onblur = handleThemeButtonsBlur;
904
904
let mut krates = Vec :: new ( ) ;
905
905
906
906
if path. exists ( ) {
907
+ let prefix = format ! ( r#"{}["{}"]"# , key, krate) ;
907
908
for line in BufReader :: new ( File :: open ( path) ?) . lines ( ) {
908
909
let line = line?;
909
910
if !line. starts_with ( key) {
910
911
continue ;
911
912
}
912
- if line. starts_with ( & format ! ( r#"{}["{}"]"# , key , krate ) ) {
913
+ if line. starts_with ( & prefix ) {
913
914
continue ;
914
915
}
915
916
ret. push ( line. to_string ( ) ) ;
@@ -930,12 +931,13 @@ themePicker.onblur = handleThemeButtonsBlur;
930
931
let mut krates = Vec :: new ( ) ;
931
932
932
933
if path. exists ( ) {
934
+ let prefix = format ! ( "\" {}\" " , krate) ;
933
935
for line in BufReader :: new ( File :: open ( path) ?) . lines ( ) {
934
936
let line = line?;
935
937
if !line. starts_with ( '"' ) {
936
938
continue ;
937
939
}
938
- if line. starts_with ( & format ! ( " \" {} \" " , krate ) ) {
940
+ if line. starts_with ( & prefix ) {
939
941
continue ;
940
942
}
941
943
if line. ends_with ( ",\\ " ) {
@@ -1920,12 +1922,13 @@ fn document_full(
1920
1922
debug ! ( "Doc block: =====\n {}\n =====" , s) ;
1921
1923
render_markdown ( w, cx, & * s, item. links ( & cx. cache ) , prefix, is_hidden) ;
1922
1924
} else if !prefix. is_empty ( ) {
1923
- write ! (
1924
- w,
1925
- "<div class=\" docblock{}\" >{}</div>" ,
1926
- if is_hidden { " hidden" } else { "" } ,
1927
- prefix
1928
- ) ;
1925
+ if is_hidden {
1926
+ w. write_str ( "<div class=\" docblock hidden\" >" ) ;
1927
+ } else {
1928
+ w. write_str ( "<div class=\" docblock\" >" ) ;
1929
+ }
1930
+ w. write_str ( prefix) ;
1931
+ w. write_str ( "</div" ) ;
1929
1932
}
1930
1933
}
1931
1934
@@ -1943,11 +1946,15 @@ fn document_item_info(
1943
1946
) {
1944
1947
let item_infos = short_item_info ( item, cx, parent) ;
1945
1948
if !item_infos. is_empty ( ) {
1946
- write ! ( w, "<div class=\" item-info{}\" >" , if is_hidden { " hidden" } else { "" } ) ;
1949
+ if is_hidden {
1950
+ w. write_str ( "<div class=\" item-info hidden\" >" ) ;
1951
+ } else {
1952
+ w. write_str ( "<div class=\" item-info\" >" ) ;
1953
+ }
1947
1954
for info in item_infos {
1948
- write ! ( w , "{}" , info) ;
1955
+ w . write_str ( & info) ;
1949
1956
}
1950
- write ! ( w , "</div>" ) ;
1957
+ w . write_str ( "</div>" ) ;
1951
1958
}
1952
1959
}
1953
1960
@@ -1970,36 +1977,32 @@ fn document_non_exhaustive(w: &mut Buffer, item: &clean::Item) {
1970
1977
} ) ;
1971
1978
1972
1979
if item. is_struct ( ) {
1973
- write ! (
1974
- w,
1980
+ w. write_str (
1975
1981
"Non-exhaustive structs could have additional fields added in future. \
1976
1982
Therefore, non-exhaustive structs cannot be constructed in external crates \
1977
1983
using the traditional <code>Struct {{ .. }}</code> syntax; cannot be \
1978
1984
matched against without a wildcard <code>..</code>; and \
1979
- struct update syntax will not work."
1985
+ struct update syntax will not work.",
1980
1986
) ;
1981
1987
} else if item. is_enum ( ) {
1982
- write ! (
1983
- w,
1988
+ w. write_str (
1984
1989
"Non-exhaustive enums could have additional variants added in future. \
1985
1990
Therefore, when matching against variants of non-exhaustive enums, an \
1986
- extra wildcard arm must be added to account for any future variants."
1991
+ extra wildcard arm must be added to account for any future variants.",
1987
1992
) ;
1988
1993
} else if item. is_variant ( ) {
1989
- write ! (
1990
- w,
1994
+ w. write_str (
1991
1995
"Non-exhaustive enum variants could have additional fields added in future. \
1992
1996
Therefore, non-exhaustive enum variants cannot be constructed in external \
1993
- crates and cannot be matched against."
1997
+ crates and cannot be matched against.",
1994
1998
) ;
1995
1999
} else {
1996
- write ! (
1997
- w,
1998
- "This type will require a wildcard arm in any match statements or constructors."
2000
+ w. write_str (
2001
+ "This type will require a wildcard arm in any match statements or constructors." ,
1999
2002
) ;
2000
2003
}
2001
2004
2002
- write ! ( w , "</div>" ) ;
2005
+ w . write_str ( "</div>" ) ;
2003
2006
}
2004
2007
}
2005
2008
@@ -2136,7 +2139,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
2136
2139
curty = myty;
2137
2140
} else if myty != curty {
2138
2141
if curty. is_some ( ) {
2139
- write ! ( w , "</table>" ) ;
2142
+ w . write_str ( "</table>" ) ;
2140
2143
}
2141
2144
curty = myty;
2142
2145
let ( short, name) = item_ty_to_strs ( & myty. unwrap ( ) ) ;
@@ -2168,7 +2171,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
2168
2171
anchor( myitem. def_id, & * name. as_str( ) , cx. cache( ) )
2169
2172
) ,
2170
2173
}
2171
- write ! ( w , "</code></td></tr>" ) ;
2174
+ w . write_str ( "</code></td></tr>" ) ;
2172
2175
}
2173
2176
2174
2177
clean:: ImportItem ( ref import) => {
0 commit comments