aboutsummaryrefslogtreecommitdiff
path: root/embassy-sync
diff options
context:
space:
mode:
authorOliver Rockstedt <[email protected]>2024-10-07 18:05:15 +0200
committerOliver Rockstedt <[email protected]>2024-10-07 18:05:15 +0200
commitbf60b239e87faa0b9905a42013d8ae9a9f4162ea (patch)
tree6419fd6a02b7a31778a2400f41d1b740be3fcbfb /embassy-sync
parent42815e944af09f7de6278483caf0fb7e65ab1d1d (diff)
embassy-sync: fixed some clippy warnings
Diffstat (limited to 'embassy-sync')
-rw-r--r--embassy-sync/src/blocking_mutex/mod.rs1
-rw-r--r--embassy-sync/src/mutex.rs2
-rw-r--r--embassy-sync/src/pubsub/mod.rs4
3 files changed, 4 insertions, 3 deletions
diff --git a/embassy-sync/src/blocking_mutex/mod.rs b/embassy-sync/src/blocking_mutex/mod.rs
index 8a4a4c642..beafdb43d 100644
--- a/embassy-sync/src/blocking_mutex/mod.rs
+++ b/embassy-sync/src/blocking_mutex/mod.rs
@@ -104,6 +104,7 @@ impl<T> Mutex<raw::CriticalSectionRawMutex, T> {
104 104
105impl<T> Mutex<raw::NoopRawMutex, T> { 105impl<T> Mutex<raw::NoopRawMutex, T> {
106 /// Borrows the data 106 /// Borrows the data
107 #[allow(clippy::should_implement_trait)]
107 pub fn borrow(&self) -> &T { 108 pub fn borrow(&self) -> &T {
108 let ptr = self.data.get() as *const T; 109 let ptr = self.data.get() as *const T;
109 unsafe { &*ptr } 110 unsafe { &*ptr }
diff --git a/embassy-sync/src/mutex.rs b/embassy-sync/src/mutex.rs
index 8c3a3af9f..08f66e374 100644
--- a/embassy-sync/src/mutex.rs
+++ b/embassy-sync/src/mutex.rs
@@ -138,7 +138,7 @@ impl<M: RawMutex, T> From<T> for Mutex<M, T> {
138impl<M, T> Default for Mutex<M, T> 138impl<M, T> Default for Mutex<M, T>
139where 139where
140 M: RawMutex, 140 M: RawMutex,
141 T: ?Sized + Default, 141 T: Default,
142{ 142{
143 fn default() -> Self { 143 fn default() -> Self {
144 Self::new(Default::default()) 144 Self::new(Default::default())
diff --git a/embassy-sync/src/pubsub/mod.rs b/embassy-sync/src/pubsub/mod.rs
index 812302e2b..ae5951829 100644
--- a/embassy-sync/src/pubsub/mod.rs
+++ b/embassy-sync/src/pubsub/mod.rs
@@ -27,8 +27,8 @@ pub use subscriber::{DynSubscriber, Subscriber};
27/// 27///
28/// - With [Pub::publish()] the publisher has to wait until there is space in the internal message queue. 28/// - With [Pub::publish()] the publisher has to wait until there is space in the internal message queue.
29/// - With [Pub::publish_immediate()] the publisher doesn't await and instead lets the oldest message 29/// - With [Pub::publish_immediate()] the publisher doesn't await and instead lets the oldest message
30/// in the queue drop if necessary. This will cause any [Subscriber] that missed the message to receive 30/// in the queue drop if necessary. This will cause any [Subscriber] that missed the message to receive
31/// an error to indicate that it has lagged. 31/// an error to indicate that it has lagged.
32/// 32///
33/// ## Example 33/// ## Example
34/// 34///