embassy-sync: fixed some clippy warnings

This commit is contained in:
Oliver Rockstedt 2024-10-07 18:05:15 +02:00
parent 42815e944a
commit bf60b239e8
3 changed files with 4 additions and 3 deletions

View File

@ -104,6 +104,7 @@ impl<T> Mutex<raw::CriticalSectionRawMutex, T> {
impl<T> Mutex<raw::NoopRawMutex, T> {
/// Borrows the data
#[allow(clippy::should_implement_trait)]
pub fn borrow(&self) -> &T {
let ptr = self.data.get() as *const T;
unsafe { &*ptr }

View File

@ -138,7 +138,7 @@ impl<M: RawMutex, T> From<T> for Mutex<M, T> {
impl<M, T> Default for Mutex<M, T>
where
M: RawMutex,
T: ?Sized + Default,
T: Default,
{
fn default() -> Self {
Self::new(Default::default())