diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index 996af64175..8410b7d75c 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -269,7 +269,7 @@ pub fn codegen( let m_ident = util::monotonic_ident(&monotonic_name); let m_isr = &monotonic.args.binds; let enum_ = util::interrupt_ident(); - let spawn_handle_string = format!("{}::SpawnHandle", m.to_string()); + let spawn_handle_string = format!("{}::SpawnHandle", m); let (enable_interrupt, pend) = if &*m_isr.to_string() == "SysTick" { ( diff --git a/macros/src/codegen/software_tasks.rs b/macros/src/codegen/software_tasks.rs index 2008b6c98a..c767032f5c 100644 --- a/macros/src/codegen/software_tasks.rs +++ b/macros/src/codegen/software_tasks.rs @@ -38,6 +38,7 @@ pub fn codegen( // Create free queues and inputs / instants buffers let fq = util::fq_ident(name); + #[allow(clippy::redundant_closure)] let (fq_ty, fq_expr, mk_uninit): (_, _, Box Option<_>>) = { ( quote!(rtic::export::SCFQ<#cap_lit_p1>), diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index e865434528..46eace4c39 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -16,7 +16,7 @@ pub fn capacity_literal(capacity: usize) -> LitInt { /// Identifier for the free queue pub fn fq_ident(task: &Ident) -> Ident { - mark_internal_name(&format!("{}_FQ", task.to_string())) + mark_internal_name(&format!("{}_FQ", task)) } /// Generates a `Mutex` implementation @@ -103,17 +103,12 @@ pub fn mark_internal_name(name: &str) -> Ident { /// Generate an internal identifier for monotonics pub fn internal_monotonics_ident(task: &Ident, monotonic: &Ident, ident_name: &str) -> Ident { - mark_internal_name(&format!( - "{}_{}_{}", - task.to_string(), - monotonic.to_string(), - ident_name, - )) + mark_internal_name(&format!("{}_{}_{}", task, monotonic, ident_name,)) } /// Generate an internal identifier for tasks pub fn internal_task_ident(task: &Ident, ident_name: &str) -> Ident { - mark_internal_name(&format!("{}_{}", task.to_string(), ident_name)) + mark_internal_name(&format!("{}_{}", task, ident_name)) } fn link_section_index() -> usize { @@ -253,26 +248,19 @@ pub fn monotonic_ident(name: &str) -> Ident { } pub fn static_shared_resource_ident(name: &Ident) -> Ident { - mark_internal_name(&format!("shared_resource_{}", name.to_string())) + mark_internal_name(&format!("shared_resource_{}", name)) } pub fn static_local_resource_ident(name: &Ident) -> Ident { - mark_internal_name(&format!("local_resource_{}", name.to_string())) + mark_internal_name(&format!("local_resource_{}", name)) } pub fn declared_static_local_resource_ident(name: &Ident, task_name: &Ident) -> Ident { - mark_internal_name(&format!( - "local_{}_{}", - task_name.to_string(), - name.to_string() - )) + mark_internal_name(&format!("local_{}_{}", task_name, name)) } pub fn need_to_lock_ident(name: &Ident) -> Ident { - Ident::new( - &format!("{}_that_needs_to_be_locked", name.to_string()), - name.span(), - ) + Ident::new(&format!("{}_that_needs_to_be_locked", name), name.span()) } /// The name to get better RT flag errors diff --git a/src/tq.rs b/src/tq.rs index 26ebbd96c3..9033022bcd 100644 --- a/src/tq.rs +++ b/src/tq.rs @@ -71,6 +71,7 @@ where } /// Update the instant at an marker value to a new instant + #[allow(clippy::result_unit_err)] pub fn update_marker( &mut self, marker: u32,