From 16d6bd7ece4c4b9b72f6bd51c9b034270b745525 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 13 Sep 2026 15:12:08 -0400 Subject: Support no_std --- src/mutex/guard.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/mutex/guard.rs') diff --git a/src/mutex/guard.rs b/src/mutex/guard.rs index 538a08a..dad1cd7 100755 --- a/src/mutex/guard.rs +++ b/src/mutex/guard.rs @@ -1,7 +1,7 @@ -use std::fmt::{Debug, Display}; -use std::hash::Hash; -use std::marker::PhantomData; -use std::ops::{Deref, DerefMut}; +use core::fmt::{Debug, Display}; +use core::hash::Hash; +use core::marker::PhantomData; +use core::ops::{Deref, DerefMut}; use lock_api::RawMutex; @@ -16,7 +16,7 @@ use super::{Mutex, MutexGuard, MutexRef}; #[mutants::skip] // hashing involves RNG and is hard to test #[cfg(not(tarpaulin_include))] impl Hash for MutexRef<'_, T, R> { - fn hash(&self, state: &mut H) { + fn hash(&self, state: &mut H) { self.deref().hash(state) } } @@ -24,13 +24,13 @@ impl Hash for MutexRef<'_, T, R> { #[mutants::skip] #[cfg(not(tarpaulin_include))] impl Debug for MutexRef<'_, T, R> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { Debug::fmt(&**self, f) } } impl Display for MutexRef<'_, T, R> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { Display::fmt(&**self, f) } } @@ -90,7 +90,7 @@ impl<'a, T: ?Sized, R: RawMutex> MutexRef<'a, T, R> { #[mutants::skip] // hashing involves RNG and is hard to test #[cfg(not(tarpaulin_include))] impl Hash for MutexGuard<'_, T, R> { - fn hash(&self, state: &mut H) { + fn hash(&self, state: &mut H) { self.deref().hash(state) } } @@ -98,13 +98,13 @@ impl Hash for MutexGuard<'_, T, R> { #[mutants::skip] #[cfg(not(tarpaulin_include))] impl Debug for MutexGuard<'_, T, R> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { Debug::fmt(&**self, f) } } impl Display for MutexGuard<'_, T, R> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { Display::fmt(&**self, f) } } -- cgit v1.3.1