Fix/mute clippy errors

This commit is contained in:
Henrik Tjäder 2022-02-09 18:56:35 +01:00
parent 10ec36b443
commit 099544f655
4 changed files with 10 additions and 20 deletions

View file

@ -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" {
(

View file

@ -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<dyn Fn() -> Option<_>>) = {
(
quote!(rtic::export::SCFQ<#cap_lit_p1>),

View file

@ -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

View file

@ -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<F: FnOnce()>(
&mut self,
marker: u32,