@@ -245,7 +245,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
245
245
// (which is the position in the vector).
246
246
indices. dedup_by_key ( |i| {
247
247
(
248
- items[ * i] . def_id . clone ( ) ,
248
+ items[ * i] . def_id ,
249
249
if items[ * i] . name . as_ref ( ) . is_some ( ) { Some ( full_path ( cx, & items[ * i] ) ) } else { None } ,
250
250
items[ * i] . type_ ( ) ,
251
251
if items[ * i] . is_import ( ) { * i } else { 0 } ,
@@ -288,14 +288,14 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
288
288
Some ( ref src) => write ! (
289
289
w,
290
290
"<div class=\" item-left\" ><code>{}extern crate {} as {};" ,
291
- myitem. visibility. print_with_space( myitem. def_id. clone ( ) , cx) ,
291
+ myitem. visibility. print_with_space( myitem. def_id, cx) ,
292
292
anchor( myitem. def_id. expect_def_id( ) , & * src. as_str( ) , cx) ,
293
293
myitem. name. as_ref( ) . unwrap( ) ,
294
294
) ,
295
295
None => write ! (
296
296
w,
297
297
"<div class=\" item-left\" ><code>{}extern crate {};" ,
298
- myitem. visibility. print_with_space( myitem. def_id. clone ( ) , cx) ,
298
+ myitem. visibility. print_with_space( myitem. def_id, cx) ,
299
299
anchor(
300
300
myitem. def_id. expect_def_id( ) ,
301
301
& * myitem. name. as_ref( ) . unwrap( ) . as_str( ) ,
@@ -336,7 +336,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
336
336
<div class=\" item-right docblock-short\" >{stab_tags}</div>",
337
337
stab = stab. unwrap_or_default( ) ,
338
338
add = add,
339
- vis = myitem. visibility. print_with_space( myitem. def_id. clone ( ) , cx) ,
339
+ vis = myitem. visibility. print_with_space( myitem. def_id, cx) ,
340
340
imp = import. print( cx) ,
341
341
stab_tags = stab_tags. unwrap_or_default( ) ,
342
342
) ;
@@ -437,7 +437,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
437
437
}
438
438
439
439
fn item_function ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , f : & clean:: Function ) {
440
- let vis = it. visibility . print_with_space ( it. def_id . clone ( ) , cx) . to_string ( ) ;
440
+ let vis = it. visibility . print_with_space ( it. def_id , cx) . to_string ( ) ;
441
441
let constness = print_constness_with_space ( & f. header . constness , it. const_stability ( cx. tcx ( ) ) ) ;
442
442
let asyncness = f. header . asyncness . print_with_space ( ) ;
443
443
let unsafety = f. header . unsafety . print_with_space ( ) ;
@@ -489,7 +489,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
489
489
write ! (
490
490
w,
491
491
"{}{}{}trait {}{}{}" ,
492
- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
492
+ it. visibility. print_with_space( it. def_id, cx) ,
493
493
t. unsafety. print_with_space( ) ,
494
494
if t. is_auto { "auto " } else { "" } ,
495
495
it. name. as_ref( ) . unwrap( ) ,
@@ -710,10 +710,8 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
710
710
711
711
for implementor in foreign {
712
712
let provided_methods = implementor. inner_impl ( ) . provided_trait_methods ( cx. tcx ( ) ) ;
713
- let assoc_link = AssocItemLink :: GotoSource (
714
- implementor. impl_item . def_id . clone ( ) ,
715
- & provided_methods,
716
- ) ;
713
+ let assoc_link =
714
+ AssocItemLink :: GotoSource ( implementor. impl_item . def_id , & provided_methods) ;
717
715
render_impl (
718
716
w,
719
717
cx,
@@ -917,7 +915,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
917
915
write ! (
918
916
w,
919
917
"{}enum {}{}{}" ,
920
- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
918
+ it. visibility. print_with_space( it. def_id, cx) ,
921
919
it. name. as_ref( ) . unwrap( ) ,
922
920
e. generics. print( cx) ,
923
921
print_where_clause( & e. generics, cx, 0 , true ) ,
@@ -1105,7 +1103,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
1105
1103
write ! (
1106
1104
w,
1107
1105
"{vis}const {name}: {typ}" ,
1108
- vis = it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1106
+ vis = it. visibility. print_with_space( it. def_id, cx) ,
1109
1107
name = it. name. as_ref( ) . unwrap( ) ,
1110
1108
typ = c. type_. print( cx) ,
1111
1109
) ;
@@ -1195,7 +1193,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
1195
1193
write ! (
1196
1194
w,
1197
1195
"{vis}static {mutability}{name}: {typ}</pre>" ,
1198
- vis = it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1196
+ vis = it. visibility. print_with_space( it. def_id, cx) ,
1199
1197
mutability = s. mutability. print_with_space( ) ,
1200
1198
name = it. name. as_ref( ) . unwrap( ) ,
1201
1199
typ = s. type_. print( cx)
@@ -1209,7 +1207,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
1209
1207
write ! (
1210
1208
w,
1211
1209
" {}type {};\n }}</pre>" ,
1212
- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1210
+ it. visibility. print_with_space( it. def_id, cx) ,
1213
1211
it. name. as_ref( ) . unwrap( ) ,
1214
1212
) ;
1215
1213
@@ -1364,7 +1362,7 @@ fn render_union(
1364
1362
write ! (
1365
1363
w,
1366
1364
"{}{}{}" ,
1367
- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1365
+ it. visibility. print_with_space( it. def_id, cx) ,
1368
1366
if structhead { "union " } else { "" } ,
1369
1367
it. name. as_ref( ) . unwrap( )
1370
1368
) ;
@@ -1386,7 +1384,7 @@ fn render_union(
1386
1384
write ! (
1387
1385
w,
1388
1386
" {}{}: {},\n {}" ,
1389
- field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
1387
+ field. visibility. print_with_space( field. def_id, cx) ,
1390
1388
field. name. as_ref( ) . unwrap( ) ,
1391
1389
ty. print( cx) ,
1392
1390
tab
@@ -1416,7 +1414,7 @@ fn render_struct(
1416
1414
write ! (
1417
1415
w,
1418
1416
"{}{}{}" ,
1419
- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1417
+ it. visibility. print_with_space( it. def_id, cx) ,
1420
1418
if structhead { "struct " } else { "" } ,
1421
1419
it. name. as_ref( ) . unwrap( )
1422
1420
) ;
@@ -1442,7 +1440,7 @@ fn render_struct(
1442
1440
w,
1443
1441
"\n {} {}{}: {}," ,
1444
1442
tab,
1445
- field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
1443
+ field. visibility. print_with_space( field. def_id, cx) ,
1446
1444
field. name. as_ref( ) . unwrap( ) ,
1447
1445
ty. print( cx) ,
1448
1446
) ;
@@ -1476,7 +1474,7 @@ fn render_struct(
1476
1474
write ! (
1477
1475
w,
1478
1476
"{}{}" ,
1479
- field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
1477
+ field. visibility. print_with_space( field. def_id, cx) ,
1480
1478
ty. print( cx) ,
1481
1479
)
1482
1480
}
0 commit comments