@@ -309,7 +309,7 @@ pub fn fields(
309
309
let name_sc = Ident :: new ( & name. to_sanitized_snake_case ( ) , span) ;
310
310
let name_pc = name. to_sanitized_upper_case ( ) ;
311
311
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
313
313
let description = util:: respace ( & util:: escape_brackets ( description_raw) ) ;
314
314
315
315
let can_read = can_read
@@ -444,7 +444,7 @@ pub fn fields(
444
444
Span :: call_site ( ) ,
445
445
) ;
446
446
let doc = util:: replace_suffix (
447
- & description_with_bits ( & description_raw, sub_offset, width) ,
447
+ & description_with_bits ( description_raw, sub_offset, width) ,
448
448
suffix,
449
449
) ;
450
450
r_impl_items. extend ( quote ! {
@@ -456,7 +456,7 @@ pub fn fields(
456
456
} ) ;
457
457
}
458
458
} else {
459
- let doc = description_with_bits ( & description_raw, offset, width) ;
459
+ let doc = description_with_bits ( description_raw, offset, width) ;
460
460
r_impl_items. extend ( quote ! {
461
461
#[ doc = #doc]
462
462
#inline
@@ -809,7 +809,7 @@ pub fn fields(
809
809
Span :: call_site ( ) ,
810
810
) ;
811
811
let doc = util:: replace_suffix (
812
- & description_with_bits ( & description_raw, sub_offset, width) ,
812
+ & description_with_bits ( description_raw, sub_offset, width) ,
813
813
suffix,
814
814
) ;
815
815
let sub_offset = util:: unsuffixed ( sub_offset as u64 ) ;
@@ -832,7 +832,7 @@ pub fn fields(
832
832
}
833
833
}
834
834
} else {
835
- let doc = description_with_bits ( & description_raw, offset, width) ;
835
+ let doc = description_with_bits ( description_raw, offset, width) ;
836
836
w_impl_items. extend ( quote ! {
837
837
#[ doc = #doc]
838
838
#inline
0 commit comments