@@ -42,7 +42,7 @@ fn main() {
42
42
}
43
43
Some ( pattern) => {
44
44
if let Some ( peripheral) = find_peripheral ( & d, |n| n == pattern)
45
- . or ( find_peripheral ( & d, |n| n. contains ( pattern) ) ) {
45
+ . or_else ( || find_peripheral ( & d, |n| n. contains ( pattern) ) ) {
46
46
if let Some ( base_peripheral) = peripheral. derived_from . as_ref ( )
47
47
. and_then ( |bn| find_peripheral ( & d, |n| n == bn. to_ascii_lowercase ( ) ) ) {
48
48
let merged_peripheral = merge ( peripheral, base_peripheral) ;
@@ -72,9 +72,9 @@ fn merge(p: &svd::Peripheral, bp: &svd::Peripheral) -> svd::Peripheral {
72
72
name : p. name . clone ( ) ,
73
73
base_address : p. base_address ,
74
74
derived_from : None ,
75
- group_name : p. group_name . clone ( ) . or ( bp. group_name . clone ( ) ) ,
76
- description : p. description . clone ( ) . or ( bp. description . clone ( ) ) ,
77
- interrupt : p. interrupt . clone ( ) . or ( bp. interrupt . clone ( ) ) ,
78
- registers : p. registers . clone ( ) . or ( bp. registers . clone ( ) ) ,
75
+ group_name : p. group_name . clone ( ) . or_else ( || bp. group_name . clone ( ) ) ,
76
+ description : p. description . clone ( ) . or_else ( || bp. description . clone ( ) ) ,
77
+ interrupt : p. interrupt . clone ( ) . or_else ( || bp. interrupt . clone ( ) ) ,
78
+ registers : p. registers . clone ( ) . or_else ( || bp. registers . clone ( ) ) ,
79
79
}
80
80
}
0 commit comments