@@ -263,7 +263,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
263263 indices. dedup_by_key ( |i| {
264264 (
265265 items[ * i] . def_id ,
266- if items[ * i] . name . as_ref ( ) . is_some ( ) { Some ( full_path ( cx, & items[ * i] ) ) } else { None } ,
266+ if items[ * i] . name . is_some ( ) { Some ( full_path ( cx, & items[ * i] ) ) } else { None } ,
267267 items[ * i] . type_ ( ) ,
268268 if items[ * i] . is_import ( ) { * i } else { 0 } ,
269269 )
@@ -310,13 +310,13 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
310310 "<div class=\" item-left\" ><code>{}extern crate {} as {};" ,
311311 myitem. visibility. print_with_space( myitem. def_id, cx) ,
312312 anchor( myitem. def_id. expect_def_id( ) , src, cx) ,
313- myitem. name. as_ref ( ) . unwrap( ) ,
313+ myitem. name. unwrap( ) ,
314314 ) ,
315315 None => write ! (
316316 w,
317317 "<div class=\" item-left\" ><code>{}extern crate {};" ,
318318 myitem. visibility. print_with_space( myitem. def_id, cx) ,
319- anchor( myitem. def_id. expect_def_id( ) , * myitem. name. as_ref ( ) . unwrap( ) , cx) ,
319+ anchor( myitem. def_id. expect_def_id( ) , myitem. name. unwrap( ) , cx) ,
320320 ) ,
321321 }
322322 w. write_str ( "</code></div>" ) ;
@@ -388,7 +388,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
388388 {stab_tags}\
389389 </div>\
390390 <div class=\" item-right docblock-short\" >{docs}</div>",
391- name = * myitem. name. as_ref ( ) . unwrap( ) ,
391+ name = myitem. name. unwrap( ) ,
392392 stab_tags = extra_info_tags( myitem, item, cx. tcx( ) ) ,
393393 docs = MarkdownSummaryLine ( & doc_value, & myitem. links( cx) ) . into_string( ) ,
394394 class = myitem. type_( ) ,
@@ -460,7 +460,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
460460 let asyncness = f. header . asyncness . print_with_space ( ) ;
461461 let unsafety = f. header . unsafety . print_with_space ( ) ;
462462 let abi = print_abi_with_space ( f. header . abi ) . to_string ( ) ;
463- let name = it. name . as_ref ( ) . unwrap ( ) ;
463+ let name = it. name . unwrap ( ) ;
464464
465465 let generics_len = format ! ( "{:#}" , f. generics. print( cx) ) . len ( ) ;
466466 let header_len = "fn " . len ( )
@@ -516,7 +516,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
516516 it. visibility. print_with_space( it. def_id, cx) ,
517517 t. unsafety. print_with_space( ) ,
518518 if t. is_auto { "auto " } else { "" } ,
519- it. name. as_ref ( ) . unwrap( ) ,
519+ it. name. unwrap( ) ,
520520 t. generics. print( cx) ,
521521 bounds
522522 ) ;
@@ -657,7 +657,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
657657 }
658658
659659 fn trait_item ( w : & mut Buffer , cx : & Context < ' _ > , m : & clean:: Item , t : & clean:: Item ) {
660- let name = m. name . as_ref ( ) . unwrap ( ) ;
660+ let name = m. name . unwrap ( ) ;
661661 info ! ( "Documenting {} on {:?}" , name, t. name) ;
662662 let item_type = m. type_ ( ) ;
663663 let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
@@ -867,7 +867,7 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
867867 join_with_slash( None , & path[ ..path. len( ) - 1 ] )
868868 } ,
869869 ty = it. type_( ) ,
870- name = * it. name. as_ref ( ) . unwrap( )
870+ name = it. name. unwrap( )
871871 ) ;
872872}
873873
@@ -878,7 +878,7 @@ fn item_trait_alias(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clea
878878 write ! (
879879 w,
880880 "trait {}{}{} = {};" ,
881- it. name. as_ref ( ) . unwrap( ) ,
881+ it. name. unwrap( ) ,
882882 t. generics. print( cx) ,
883883 print_where_clause( & t. generics, cx, 0 , true ) ,
884884 bounds( & t. bounds, true , cx)
@@ -902,7 +902,7 @@ fn item_opaque_ty(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean:
902902 write ! (
903903 w,
904904 "type {}{}{where_clause} = impl {bounds};" ,
905- it. name. as_ref ( ) . unwrap( ) ,
905+ it. name. unwrap( ) ,
906906 t. generics. print( cx) ,
907907 where_clause = print_where_clause( & t. generics, cx, 0 , true ) ,
908908 bounds = bounds( & t. bounds, false , cx) ,
@@ -941,7 +941,7 @@ fn item_typedef(
941941 write ! (
942942 w,
943943 "type {}{}{where_clause} = {type_};" ,
944- it. name. as_ref ( ) . unwrap( ) ,
944+ it. name. unwrap( ) ,
945945 t. generics. print( cx) ,
946946 where_clause = print_where_clause( & t. generics, cx, 0 , true ) ,
947947 type_ = t. type_. print( cx) ,
@@ -994,7 +994,7 @@ fn item_union(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::Uni
994994 Fields<a href=\" #fields\" class=\" anchor\" ></a></h2>"
995995 ) ;
996996 for ( field, ty) in fields {
997- let name = field. name . as_ref ( ) . expect ( "union field name" ) ;
997+ let name = field. name . expect ( "union field name" ) ;
998998 let id = format ! ( "{}.{}" , ItemType :: StructField , name) ;
999999 write ! (
10001000 w,
@@ -1039,7 +1039,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
10391039 w,
10401040 "{}enum {}{}{}" ,
10411041 it. visibility. print_with_space( it. def_id, cx) ,
1042- it. name. as_ref ( ) . unwrap( ) ,
1042+ it. name. unwrap( ) ,
10431043 e. generics. print( cx) ,
10441044 print_where_clause( & e. generics, cx, 0 , true ) ,
10451045 ) ;
@@ -1054,7 +1054,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
10541054 }
10551055 for v in & e. variants {
10561056 w. write_str ( " " ) ;
1057- let name = v. name . as_ref ( ) . unwrap ( ) ;
1057+ let name = v. name . unwrap ( ) ;
10581058 match * v. kind {
10591059 clean:: VariantItem ( ref var) => match var {
10601060 clean:: Variant :: CLike => write ! ( w, "{}" , name) ,
@@ -1103,15 +1103,14 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
11031103 ) ;
11041104 document_non_exhaustive ( w, it) ;
11051105 for variant in & e. variants {
1106- let id =
1107- cx. derive_id ( format ! ( "{}.{}" , ItemType :: Variant , variant. name. as_ref( ) . unwrap( ) ) ) ;
1106+ let id = cx. derive_id ( format ! ( "{}.{}" , ItemType :: Variant , variant. name. unwrap( ) ) ) ;
11081107 write ! (
11091108 w,
11101109 "<h3 id=\" {id}\" class=\" variant small-section-header\" >\
11111110 <a href=\" #{id}\" class=\" anchor field\" ></a>\
11121111 <code>{name}",
11131112 id = id,
1114- name = variant. name. as_ref ( ) . unwrap( )
1113+ name = variant. name. unwrap( )
11151114 ) ;
11161115 if let clean:: VariantItem ( clean:: Variant :: Tuple ( ref s) ) = * variant. kind {
11171116 w. write_str ( "(" ) ;
@@ -1137,11 +1136,8 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
11371136 } ;
11381137
11391138 if let Some ( ( heading, fields) ) = heading_and_fields {
1140- let variant_id = cx. derive_id ( format ! (
1141- "{}.{}.fields" ,
1142- ItemType :: Variant ,
1143- variant. name. as_ref( ) . unwrap( )
1144- ) ) ;
1139+ let variant_id =
1140+ cx. derive_id ( format ! ( "{}.{}.fields" , ItemType :: Variant , variant. name. unwrap( ) ) ) ;
11451141 write ! ( w, "<div class=\" sub-variant\" id=\" {id}\" >" , id = variant_id) ;
11461142 write ! ( w, "<h4>{heading}</h4>" , heading = heading) ;
11471143 document_non_exhaustive ( w, variant) ;
@@ -1151,8 +1147,8 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
11511147 clean:: StructFieldItem ( ref ty) => {
11521148 let id = cx. derive_id ( format ! (
11531149 "variant.{}.field.{}" ,
1154- variant. name. as_ref ( ) . unwrap( ) ,
1155- field. name. as_ref ( ) . unwrap( )
1150+ variant. name. unwrap( ) ,
1151+ field. name. unwrap( )
11561152 ) ) ;
11571153 write ! (
11581154 w,
@@ -1162,7 +1158,7 @@ fn item_enum(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, e: &clean::Enum
11621158 <code>{f}: {t}</code>\
11631159 </span>",
11641160 id = id,
1165- f = field. name. as_ref ( ) . unwrap( ) ,
1161+ f = field. name. unwrap( ) ,
11661162 t = ty. print( cx)
11671163 ) ;
11681164 document ( w, cx, field, Some ( variant) , HeadingOffset :: H5 ) ;
@@ -1201,7 +1197,7 @@ fn item_macro(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Mac
12011197
12021198fn item_proc_macro ( w : & mut Buffer , cx : & Context < ' _ > , it : & clean:: Item , m : & clean:: ProcMacro ) {
12031199 wrap_into_docblock ( w, |w| {
1204- let name = it. name . as_ref ( ) . expect ( "proc-macros always have names" ) ;
1200+ let name = it. name . expect ( "proc-macros always have names" ) ;
12051201 match m. kind {
12061202 MacroKind :: Bang => {
12071203 wrap_item ( w, "macro" , |w| {
@@ -1245,7 +1241,7 @@ fn item_constant(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, c: &clean::
12451241 w,
12461242 "{vis}const {name}: {typ}" ,
12471243 vis = it. visibility. print_with_space( it. def_id, cx) ,
1248- name = it. name. as_ref ( ) . unwrap( ) ,
1244+ name = it. name. unwrap( ) ,
12491245 typ = c. type_. print( cx) ,
12501246 ) ;
12511247
@@ -1338,7 +1334,7 @@ fn item_static(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, s: &clean::St
13381334 "{vis}static {mutability}{name}: {typ}" ,
13391335 vis = it. visibility. print_with_space( it. def_id, cx) ,
13401336 mutability = s. mutability. print_with_space( ) ,
1341- name = it. name. as_ref ( ) . unwrap( ) ,
1337+ name = it. name. unwrap( ) ,
13421338 typ = s. type_. print( cx)
13431339 ) ;
13441340 } ) ;
@@ -1355,7 +1351,7 @@ fn item_foreign_type(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item) {
13551351 w,
13561352 " {}type {};\n }}" ,
13571353 it. visibility. print_with_space( it. def_id, cx) ,
1358- it. name. as_ref ( ) . unwrap( ) ,
1354+ it. name. unwrap( ) ,
13591355 ) ;
13601356 } ) ;
13611357 } ) ;
@@ -1523,12 +1519,7 @@ fn render_union(
15231519 tab : & str ,
15241520 cx : & Context < ' _ > ,
15251521) {
1526- write ! (
1527- w,
1528- "{}union {}" ,
1529- it. visibility. print_with_space( it. def_id, cx) ,
1530- it. name. as_ref( ) . unwrap( )
1531- ) ;
1522+ write ! ( w, "{}union {}" , it. visibility. print_with_space( it. def_id, cx) , it. name. unwrap( ) ) ;
15321523 if let Some ( g) = g {
15331524 write ! ( w, "{}" , g. print( cx) ) ;
15341525 write ! ( w, "{}" , print_where_clause( g, cx, 0 , true ) ) ;
@@ -1548,7 +1539,7 @@ fn render_union(
15481539 w,
15491540 " {}{}: {},\n {}" ,
15501541 field. visibility. print_with_space( field. def_id, cx) ,
1551- field. name. as_ref ( ) . unwrap( ) ,
1542+ field. name. unwrap( ) ,
15521543 ty. print( cx) ,
15531544 tab
15541545 ) ;
@@ -1579,7 +1570,7 @@ fn render_struct(
15791570 "{}{}{}" ,
15801571 it. visibility. print_with_space( it. def_id, cx) ,
15811572 if structhead { "struct " } else { "" } ,
1582- it. name. as_ref ( ) . unwrap( )
1573+ it. name. unwrap( )
15831574 ) ;
15841575 if let Some ( g) = g {
15851576 write ! ( w, "{}" , g. print( cx) )
@@ -1604,7 +1595,7 @@ fn render_struct(
16041595 "\n {} {}{}: {}," ,
16051596 tab,
16061597 field. visibility. print_with_space( field. def_id, cx) ,
1607- field. name. as_ref ( ) . unwrap( ) ,
1598+ field. name. unwrap( ) ,
16081599 ty. print( cx) ,
16091600 ) ;
16101601 }
0 commit comments