Merge pull request #2980 from sourcebox/sync-additions

embassy-sync: fixed some clippy warnings
This commit is contained in:
Dario Nieuwenhuis 2024-05-21 21:08:40 +00:00 committed by GitHub
commit c7c5723f8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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