@@ -245,7 +245,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
245245 // (which is the position in the vector).
246246 indices. dedup_by_key ( |i| {
247247 (
248- items[ * i] . def_id . clone ( ) ,
248+ items[ * i] . def_id ,
249249 if items[ * i] . name . as_ref ( ) . is_some ( ) { Some ( full_path ( cx, & items[ * i] ) ) } else { None } ,
250250 items[ * i] . type_ ( ) ,
251251 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
288288 Some ( ref src) => write ! (
289289 w,
290290 "<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) ,
292292 anchor( myitem. def_id. expect_def_id( ) , & * src. as_str( ) , cx) ,
293293 myitem. name. as_ref( ) . unwrap( ) ,
294294 ) ,
295295 None => write ! (
296296 w,
297297 "<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) ,
299299 anchor(
300300 myitem. def_id. expect_def_id( ) ,
301301 & * myitem. name. as_ref( ) . unwrap( ) . as_str( ) ,
@@ -336,7 +336,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
336336 <div class=\" item-right docblock-short\" >{stab_tags}</div>",
337337 stab = stab. unwrap_or_default( ) ,
338338 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) ,
340340 imp = import. print( cx) ,
341341 stab_tags = stab_tags. unwrap_or_default( ) ,
342342 ) ;
@@ -437,7 +437,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
437437}
438438
439439fn 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 ( ) ;
441441 let constness = print_constness_with_space ( & f. header . constness , it. const_stability ( cx. tcx ( ) ) ) ;
442442 let asyncness = f. header . asyncness . print_with_space ( ) ;
443443 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
489489 write ! (
490490 w,
491491 "{}{}{}trait {}{}{}" ,
492- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
492+ it. visibility. print_with_space( it. def_id, cx) ,
493493 t. unsafety. print_with_space( ) ,
494494 if t. is_auto { "auto " } else { "" } ,
495495 it. name. as_ref( ) . unwrap( ) ,
@@ -710,10 +710,8 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
710710
711711 for implementor in foreign {
712712 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) ;
717715 render_impl (
718716 w,
719717 cx,
@@ -917,7 +915,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
917915 write ! (
918916 w,
919917 "{}enum {}{}{}" ,
920- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
918+ it. visibility. print_with_space( it. def_id, cx) ,
921919 it. name. as_ref( ) . unwrap( ) ,
922920 e. generics. print( cx) ,
923921 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::
11051103 write ! (
11061104 w,
11071105 "{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) ,
11091107 name = it. name. as_ref( ) . unwrap( ) ,
11101108 typ = c. type_. print( cx) ,
11111109 ) ;
@@ -1195,7 +1193,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
11951193 write ! (
11961194 w,
11971195 "{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) ,
11991197 mutability = s. mutability. print_with_space( ) ,
12001198 name = it. name. as_ref( ) . unwrap( ) ,
12011199 typ = s. type_. print( cx)
@@ -1209,7 +1207,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
12091207 write ! (
12101208 w,
12111209 " {}type {};\n }}</pre>" ,
1212- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1210+ it. visibility. print_with_space( it. def_id, cx) ,
12131211 it. name. as_ref( ) . unwrap( ) ,
12141212 ) ;
12151213
@@ -1364,7 +1362,7 @@ fn render_union(
13641362 write ! (
13651363 w,
13661364 "{}{}{}" ,
1367- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1365+ it. visibility. print_with_space( it. def_id, cx) ,
13681366 if structhead { "union " } else { "" } ,
13691367 it. name. as_ref( ) . unwrap( )
13701368 ) ;
@@ -1386,7 +1384,7 @@ fn render_union(
13861384 write ! (
13871385 w,
13881386 " {}{}: {},\n {}" ,
1389- field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
1387+ field. visibility. print_with_space( field. def_id, cx) ,
13901388 field. name. as_ref( ) . unwrap( ) ,
13911389 ty. print( cx) ,
13921390 tab
@@ -1416,7 +1414,7 @@ fn render_struct(
14161414 write ! (
14171415 w,
14181416 "{}{}{}" ,
1419- it. visibility. print_with_space( it. def_id. clone ( ) , cx) ,
1417+ it. visibility. print_with_space( it. def_id, cx) ,
14201418 if structhead { "struct " } else { "" } ,
14211419 it. name. as_ref( ) . unwrap( )
14221420 ) ;
@@ -1442,7 +1440,7 @@ fn render_struct(
14421440 w,
14431441 "\n {} {}{}: {}," ,
14441442 tab,
1445- field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
1443+ field. visibility. print_with_space( field. def_id, cx) ,
14461444 field. name. as_ref( ) . unwrap( ) ,
14471445 ty. print( cx) ,
14481446 ) ;
@@ -1476,7 +1474,7 @@ fn render_struct(
14761474 write ! (
14771475 w,
14781476 "{}{}" ,
1479- field. visibility. print_with_space( field. def_id. clone ( ) , cx) ,
1477+ field. visibility. print_with_space( field. def_id, cx) ,
14801478 ty. print( cx) ,
14811479 )
14821480 }
0 commit comments