@@ -309,7 +309,7 @@ pub fn fields(
309309 let name_sc = Ident :: new ( & name. to_sanitized_snake_case ( ) , span) ;
310310 let name_pc = name. to_sanitized_upper_case ( ) ;
311311 let bits = Ident :: new ( if width == 1 { "bit" } else { "bits" } , span) ;
312- let description_raw = f. description . as_ref ( ) . map ( |s| s . as_str ( ) ) . unwrap_or ( "" ) ; // raw description, if absent using empty string
312+ let description_raw = f. description . as_deref ( ) . unwrap_or ( "" ) ; // raw description, if absent using empty string
313313 let description = util:: respace ( & util:: escape_brackets ( description_raw) ) ;
314314
315315 let can_read = can_read
@@ -444,7 +444,7 @@ pub fn fields(
444444 Span :: call_site ( ) ,
445445 ) ;
446446 let doc = util:: replace_suffix (
447- & description_with_bits ( & description_raw, sub_offset, width) ,
447+ & description_with_bits ( description_raw, sub_offset, width) ,
448448 suffix,
449449 ) ;
450450 r_impl_items. extend ( quote ! {
@@ -456,7 +456,7 @@ pub fn fields(
456456 } ) ;
457457 }
458458 } else {
459- let doc = description_with_bits ( & description_raw, offset, width) ;
459+ let doc = description_with_bits ( description_raw, offset, width) ;
460460 r_impl_items. extend ( quote ! {
461461 #[ doc = #doc]
462462 #inline
@@ -809,7 +809,7 @@ pub fn fields(
809809 Span :: call_site ( ) ,
810810 ) ;
811811 let doc = util:: replace_suffix (
812- & description_with_bits ( & description_raw, sub_offset, width) ,
812+ & description_with_bits ( description_raw, sub_offset, width) ,
813813 suffix,
814814 ) ;
815815 let sub_offset = util:: unsuffixed ( sub_offset as u64 ) ;
@@ -832,7 +832,7 @@ pub fn fields(
832832 }
833833 }
834834 } else {
835- let doc = description_with_bits ( & description_raw, offset, width) ;
835+ let doc = description_with_bits ( description_raw, offset, width) ;
836836 w_impl_items. extend ( quote ! {
837837 #[ doc = #doc]
838838 #inline
0 commit comments