@@ -25,7 +25,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result
25
25
let mut path = None ;
26
26
let dpath = p. derived_from . take ( ) ;
27
27
if let Some ( dpath) = dpath {
28
- path = derive_peripheral ( & mut p, & dpath, & index) ?;
28
+ path = derive_peripheral ( & mut p, & dpath, index) ?;
29
29
}
30
30
31
31
let name = util:: name_of ( & p, config. ignore_groups ) ;
@@ -162,7 +162,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result
162
162
163
163
// Build up an alternate erc list by expanding any derived registers/clusters
164
164
// erc: *E*ither *R*egister or *C*luster
165
- let mut ercs = p. registers . take ( ) . unwrap_or ( Vec :: new ( ) ) ;
165
+ let mut ercs = p. registers . take ( ) . unwrap_or_default ( ) ;
166
166
167
167
// No `struct RegisterBlock` can be generated
168
168
if ercs. is_empty ( ) {
@@ -922,7 +922,7 @@ fn cluster_block(
922
922
let mut cpath = None ;
923
923
let dpath = c. derived_from . take ( ) ;
924
924
if let Some ( dpath) = dpath {
925
- cpath = derive_cluster ( c, & dpath, & path, index) ?;
925
+ cpath = derive_cluster ( c, & dpath, path, index) ?;
926
926
}
927
927
let cpath = cpath. unwrap_or_else ( || path. new_cluster ( & c. name ) ) ;
928
928
mod_items. extend ( cluster_block ( c, & cpath, index, config) ?) ;
@@ -933,7 +933,7 @@ fn cluster_block(
933
933
let mut rpath = None ;
934
934
let dpath = reg. derived_from . take ( ) ;
935
935
if let Some ( dpath) = dpath {
936
- rpath = derive_register ( reg, & dpath, & path, index) ?;
936
+ rpath = derive_register ( reg, & dpath, path, index) ?;
937
937
}
938
938
let rpath = rpath. unwrap_or_else ( || path. new_register ( & reg. name ) ) ;
939
939
match register:: render ( reg, & rpath, index, config) {
0 commit comments