@@ -31,11 +31,10 @@ use crate::html::format::{
31
31
display_fn, join_with_double_colon, print_abi_with_space, print_constness_with_space,
32
32
print_where_clause, visibility_print_with_space, Buffer , Ending , PrintWithSpace ,
33
33
} ;
34
- use crate :: html:: layout :: Page ;
34
+ use crate :: html:: highlight ;
35
35
use crate :: html:: markdown:: { HeadingOffset , MarkdownSummaryLine } ;
36
36
use crate :: html:: render:: { document_full, document_item_info} ;
37
37
use crate :: html:: url_parts_builder:: UrlPartsBuilder ;
38
- use crate :: html:: { highlight, static_files} ;
39
38
40
39
use askama:: Template ;
41
40
use itertools:: Itertools ;
@@ -157,8 +156,6 @@ struct PathComponent {
157
156
#[ derive( Template ) ]
158
157
#[ template( path = "print_item.html" ) ]
159
158
struct ItemVars < ' a > {
160
- static_root_path : & ' a str ,
161
- clipboard_svg : & ' static static_files:: StaticFile ,
162
159
typ : & ' a str ,
163
160
name : & ' a str ,
164
161
item_type : & ' a str ,
@@ -178,12 +175,7 @@ fn print_where_clause_and_check<'a, 'tcx: 'a>(
178
175
len_before != buffer. len ( )
179
176
}
180
177
181
- pub ( super ) fn print_item (
182
- cx : & mut Context < ' _ > ,
183
- item : & clean:: Item ,
184
- buf : & mut Buffer ,
185
- page : & Page < ' _ > ,
186
- ) {
178
+ pub ( super ) fn print_item ( cx : & mut Context < ' _ > , item : & clean:: Item , buf : & mut Buffer ) {
187
179
debug_assert ! ( !item. is_stripped( ) ) ;
188
180
let typ = match * item. kind {
189
181
clean:: ModuleItem ( _) => {
@@ -252,8 +244,6 @@ pub(super) fn print_item(
252
244
} ;
253
245
254
246
let item_vars = ItemVars {
255
- static_root_path : & page. get_static_root_path ( ) ,
256
- clipboard_svg : & static_files:: STATIC_FILES . clipboard_svg ,
257
247
typ,
258
248
name : item. name . as_ref ( ) . unwrap ( ) . as_str ( ) ,
259
249
item_type : & item. type_ ( ) . to_string ( ) ,
@@ -1237,22 +1227,18 @@ fn item_opaque_ty(
1237
1227
}
1238
1228
1239
1229
fn item_type_alias ( w : & mut Buffer , cx : & mut Context < ' _ > , it : & clean:: Item , t : & clean:: TypeAlias ) {
1240
- fn write_content ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , t : & clean:: TypeAlias ) {
1241
- wrap_item ( w, |w| {
1242
- write ! (
1243
- w,
1244
- "{attrs}{vis}type {name}{generics}{where_clause} = {type_};" ,
1245
- attrs = render_attributes_in_pre( it, "" , cx) ,
1246
- vis = visibility_print_with_space( it, cx) ,
1247
- name = it. name. unwrap( ) ,
1248
- generics = t. generics. print( cx) ,
1249
- where_clause = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
1250
- type_ = t. type_. print( cx) ,
1251
- ) ;
1252
- } ) ;
1253
- }
1254
-
1255
- write_content ( w, cx, it, t) ;
1230
+ wrap_item ( w, |w| {
1231
+ write ! (
1232
+ w,
1233
+ "{attrs}{vis}type {name}{generics}{where_clause} = {type_};" ,
1234
+ attrs = render_attributes_in_pre( it, "" , cx) ,
1235
+ vis = visibility_print_with_space( it, cx) ,
1236
+ name = it. name. unwrap( ) ,
1237
+ generics = t. generics. print( cx) ,
1238
+ where_clause = print_where_clause( & t. generics, cx, 0 , Ending :: Newline ) ,
1239
+ type_ = t. type_. print( cx) ,
1240
+ ) ;
1241
+ } ) ;
1256
1242
1257
1243
write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) ) ;
1258
1244
0 commit comments