@@ -42,7 +42,7 @@ fn main() {
4242 }
4343 Some ( pattern) => {
4444 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) ) ) {
4646 if let Some ( base_peripheral) = peripheral. derived_from . as_ref ( )
4747 . and_then ( |bn| find_peripheral ( & d, |n| n == bn. to_ascii_lowercase ( ) ) ) {
4848 let merged_peripheral = merge ( peripheral, base_peripheral) ;
@@ -72,9 +72,9 @@ fn merge(p: &svd::Peripheral, bp: &svd::Peripheral) -> svd::Peripheral {
7272 name : p. name . clone ( ) ,
7373 base_address : p. base_address ,
7474 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 ( ) ) ,
7979 }
8080}
0 commit comments