mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-30 13:50:37 +00:00
embassy-sync: fixed some clippy warnings
This commit is contained in:
parent
42815e944a
commit
bf60b239e8
@ -104,6 +104,7 @@ impl<T> Mutex<raw::CriticalSectionRawMutex, T> {
|
|||||||
|
|
||||||
impl<T> Mutex<raw::NoopRawMutex, T> {
|
impl<T> Mutex<raw::NoopRawMutex, T> {
|
||||||
/// Borrows the data
|
/// Borrows the data
|
||||||
|
#[allow(clippy::should_implement_trait)]
|
||||||
pub fn borrow(&self) -> &T {
|
pub fn borrow(&self) -> &T {
|
||||||
let ptr = self.data.get() as *const T;
|
let ptr = self.data.get() as *const T;
|
||||||
unsafe { &*ptr }
|
unsafe { &*ptr }
|
||||||
|
@ -138,7 +138,7 @@ impl<M: RawMutex, T> From<T> for Mutex<M, T> {
|
|||||||
impl<M, T> Default for Mutex<M, T>
|
impl<M, T> Default for Mutex<M, T>
|
||||||
where
|
where
|
||||||
M: RawMutex,
|
M: RawMutex,
|
||||||
T: ?Sized + Default,
|
T: Default,
|
||||||
{
|
{
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new(Default::default())
|
Self::new(Default::default())
|
||||||
|
@ -27,8 +27,8 @@ pub use subscriber::{DynSubscriber, Subscriber};
|
|||||||
///
|
///
|
||||||
/// - With [Pub::publish()] the publisher has to wait until there is space in the internal message queue.
|
/// - With [Pub::publish()] the publisher has to wait until there is space in the internal message queue.
|
||||||
/// - With [Pub::publish_immediate()] the publisher doesn't await and instead lets the oldest message
|
/// - With [Pub::publish_immediate()] the publisher doesn't await and instead lets the oldest message
|
||||||
/// in the queue drop if necessary. This will cause any [Subscriber] that missed the message to receive
|
/// in the queue drop if necessary. This will cause any [Subscriber] that missed the message to receive
|
||||||
/// an error to indicate that it has lagged.
|
/// an error to indicate that it has lagged.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user