mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 12:12:50 +01:00
Fix clippy lints
This commit is contained in:
parent
9989af1b97
commit
2efdef6029
7 changed files with 38 additions and 2 deletions
|
@ -29,6 +29,12 @@ impl<T> DoublyLinkedList<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> Default for DoublyLinkedList<T> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone> DoublyLinkedList<T> {
|
||||
const R: Ordering = Ordering::Relaxed;
|
||||
|
||||
|
|
|
@ -64,3 +64,9 @@ impl CriticalSectionWakerRegistration {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for CriticalSectionWakerRegistration {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> TokenStream2 {
|
|||
let call_idle = if let Some(idle) = &app.idle {
|
||||
let name = &idle.name;
|
||||
quote!(#name(#name::Context::new()))
|
||||
} else if analysis.channels.get(&0).is_some() {
|
||||
} else if analysis.channels.contains_key(&0) {
|
||||
let dispatcher = util::zero_prio_dispatcher_ident();
|
||||
quote!(#dispatcher();)
|
||||
} else {
|
||||
|
|
|
@ -147,7 +147,7 @@ pub fn codegen(ctxt: Context, app: &App, analysis: &Analysis) -> TokenStream2 {
|
|||
let priority = spawnee.args.priority;
|
||||
let cfgs = &spawnee.cfgs;
|
||||
// Store a copy of the task cfgs
|
||||
task_cfgs = cfgs.clone();
|
||||
task_cfgs.clone_from(cfgs);
|
||||
|
||||
let pend_interrupt = if priority > 0 {
|
||||
let int_mod = interrupt_mod(app);
|
||||
|
|
|
@ -53,6 +53,12 @@ struct UnsafeAccess<'a, const N: usize> {
|
|||
num_senders: &'a mut usize,
|
||||
}
|
||||
|
||||
impl<T, const N: usize> Default for Channel<T, N> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, const N: usize> Channel<T, N> {
|
||||
const _CHECK: () = assert!(N < 256, "This queue support a maximum of 255 entries");
|
||||
|
||||
|
|
|
@ -87,6 +87,12 @@ impl<Backend: TimerQueueBackend> LinkPtr<Backend> {
|
|||
unsafe impl<Backend: TimerQueueBackend> Send for LinkPtr<Backend> {}
|
||||
unsafe impl<Backend: TimerQueueBackend> Sync for LinkPtr<Backend> {}
|
||||
|
||||
impl<Backend: TimerQueueBackend> Default for TimerQueue<Backend> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<Backend: TimerQueueBackend> TimerQueue<Backend> {
|
||||
/// Make a new queue.
|
||||
pub const fn new() -> Self {
|
||||
|
|
|
@ -52,6 +52,12 @@ impl AsyncTaskExecutorPtr {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for AsyncTaskExecutorPtr {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
/// Executor for an async task.
|
||||
pub struct AsyncTaskExecutor<F: Future> {
|
||||
// `task` is protected by the `running` flag.
|
||||
|
@ -80,6 +86,12 @@ macro_rules! from_ptr_n_args {
|
|||
};
|
||||
}
|
||||
|
||||
impl<F: Future> Default for AsyncTaskExecutor<F> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl<F: Future> AsyncTaskExecutor<F> {
|
||||
/// Create a new executor.
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Reference in a new issue