aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/util.rs
diff options
context:
space:
mode:
authorGravatar Henrik Tjäder <henrik@tjaders.com> 2020-10-13 14:16:33 +0000
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2020-10-15 17:09:27 +0000
commit21253297e4a11a1d9f9c5069578cf9c69a3de31b (patch)
tree896d527bfd204f788eacc3dc791966fb88e287be /macros/src/codegen/util.rs
parent355cb82d0693fe108ac28ec8a0d77e8aab4e6e06 (diff)
downloadrtic-21253297e4a11a1d9f9c5069578cf9c69a3de31b.tar.gz
rtic-21253297e4a11a1d9f9c5069578cf9c69a3de31b.tar.zst
rtic-21253297e4a11a1d9f9c5069578cf9c69a3de31b.zip
Implement all clippy suggestions
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r--macros/src/codegen/util.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs
index f04ccb23..bc8bfb8d 100644
--- a/macros/src/codegen/util.rs
+++ b/macros/src/codegen/util.rs
@@ -90,12 +90,17 @@ pub fn interrupt_ident() -> Ident {
pub fn is_exception(name: &Ident) -> bool {
let s = name.to_string();
- match &*s {
- "MemoryManagement" | "BusFault" | "UsageFault" | "SecureFault" | "SVCall"
- | "DebugMonitor" | "PendSV" | "SysTick" => true,
-
- _ => false,
- }
+ matches!(
+ &*s,
+ "MemoryManagement"
+ | "BusFault"
+ | "UsageFault"
+ | "SecureFault"
+ | "SVCall"
+ | "DebugMonitor"
+ | "PendSV"
+ | "SysTick"
+ )
}
/// Generates a pre-reexport identifier for the "late resources" struct
@@ -209,7 +214,7 @@ pub fn rq_ident(priority: u8) -> Ident {
/// Generates an identifier for the `enum` of `schedule`-able tasks
pub fn schedule_t_ident() -> Ident {
- Ident::new(&format!("SCHED_T"), Span::call_site())
+ Ident::new(&"SCHED_T".to_string(), Span::call_site())
}
/// Generates an identifier for the `enum` of `spawn`-able tasks
@@ -229,5 +234,5 @@ pub fn suffixed(name: &str) -> Ident {
///
/// At most there is one timer queue
pub fn tq_ident() -> Ident {
- Ident::new(&format!("TQ"), Span::call_site())
+ Ident::new(&"TQ".to_string(), Span::call_site())
}