diff options
author | 2020-10-13 14:16:33 +0000 | |
---|---|---|
committer | 2020-10-15 17:09:27 +0000 | |
commit | 21253297e4a11a1d9f9c5069578cf9c69a3de31b (patch) | |
tree | 896d527bfd204f788eacc3dc791966fb88e287be /macros/src/codegen/util.rs | |
parent | 355cb82d0693fe108ac28ec8a0d77e8aab4e6e06 (diff) | |
download | rtic-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.rs | 21 |
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()) } |