embassy-sync: fixed some clippy warnings

This commit is contained in:
Oliver Rockstedt
2024-05-21 22:59:39 +02:00
parent 2da2e57b38
commit 73e523ab14
4 changed files with 8 additions and 8 deletions

@ -42,7 +42,7 @@ where
M: RawMutex, M: RawMutex,
{ {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Sender { channel: self.channel } *self
} }
} }
@ -81,7 +81,7 @@ pub struct DynamicSender<'ch, T> {
impl<'ch, T> Clone for DynamicSender<'ch, T> { impl<'ch, T> Clone for DynamicSender<'ch, T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
DynamicSender { channel: self.channel } *self
} }
} }
@ -135,7 +135,7 @@ where
M: RawMutex, M: RawMutex,
{ {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Receiver { channel: self.channel } *self
} }
} }
@ -188,7 +188,7 @@ pub struct DynamicReceiver<'ch, T> {
impl<'ch, T> Clone for DynamicReceiver<'ch, T> { impl<'ch, T> Clone for DynamicReceiver<'ch, T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
DynamicReceiver { channel: self.channel } *self
} }
} }

@ -25,7 +25,7 @@ where
M: RawMutex, M: RawMutex,
{ {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Writer { pipe: self.pipe } *self
} }
} }

@ -33,7 +33,7 @@ where
M: RawMutex, M: RawMutex,
{ {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Sender { channel: self.channel } *self
} }
} }
@ -101,7 +101,7 @@ where
M: RawMutex, M: RawMutex,
{ {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Receiver { channel: self.channel } *self
} }
} }

@ -14,7 +14,7 @@ impl<const N: usize> MultiWakerRegistration<N> {
} }
/// Register a waker. If the buffer is full the function returns it in the error /// Register a waker. If the buffer is full the function returns it in the error
pub fn register<'a>(&mut self, w: &'a Waker) { pub fn register(&mut self, w: &Waker) {
// If we already have some waker that wakes the same task as `w`, do nothing. // If we already have some waker that wakes the same task as `w`, do nothing.
// This avoids cloning wakers, and avoids unnecessary mass-wakes. // This avoids cloning wakers, and avoids unnecessary mass-wakes.
for w2 in &self.wakers { for w2 in &self.wakers {