summaryrefslogtreecommitdiff
path: root/stm32-metapac-gen/src/lib.rs
diff options
context:
space:
mode:
authorTimo Kröger <timokroeger93@gmail.com>2021-08-04 12:51:05 +0200
committerTimo Kröger <timokroeger93@gmail.com>2021-08-04 12:51:24 +0200
commitf240edc5792bb976bb42e26164e8a0a9169f6ac5 (patch)
tree31333a7ac255cea8abf6652a5e7c0c54f1354b98 /stm32-metapac-gen/src/lib.rs
parente21faaeb47e84b57ffb748b289b5dcba6cc52118 (diff)
downloadembassy-f240edc5792bb976bb42e26164e8a0a9169f6ac5.zip
Remove broken panic message
Diffstat (limited to 'stm32-metapac-gen/src/lib.rs')
-rw-r--r--stm32-metapac-gen/src/lib.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/stm32-metapac-gen/src/lib.rs b/stm32-metapac-gen/src/lib.rs
index abeb6d84..ae401bb6 100644
--- a/stm32-metapac-gen/src/lib.rs
+++ b/stm32-metapac-gen/src/lib.rs
@@ -447,11 +447,13 @@ pub fn gen(options: Options) {
Some(clock) => clock.as_str(),
None => {
// No clock was specified, derive the clock name from the enable register name.
- let re = Regex::new("([A-Z]+\\d*).*").unwrap();
- let caps = re.captures(enable_reg).expect(
- "unable to derive clock name from register name {}",
- );
- caps.get(1).unwrap().as_str()
+ Regex::new("([A-Z]+\\d*).*")
+ .unwrap()
+ .captures(enable_reg)
+ .unwrap()
+ .get(1)
+ .unwrap()
+ .as_str()
}
};