diff options
| author | Mica White <botahamec@outlook.com> | 2026-08-26 20:46:31 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-08-26 20:46:31 -0400 |
| commit | 55b3a2425b242fbc5c6e471f220eeb8b949e8751 (patch) | |
| tree | 5ceb7910b60cc7331024b7ce1d49ec259e0302a8 /src/iterator/guard.rs | |
| parent | 6f6e030ea7edb9d155ebf21b5d42936c20801b50 (diff) | |
Add tests
Diffstat (limited to 'src/iterator/guard.rs')
| -rw-r--r-- | src/iterator/guard.rs | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/iterator/guard.rs b/src/iterator/guard.rs deleted file mode 100644 index cb220ac..0000000 --- a/src/iterator/guard.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::fmt::{Debug, Display}; -use std::hash::Hash; -use std::ops::{Deref, DerefMut}; - -use super::IteratorGuard; - -#[mutants::skip] // hashing involves RNG and is hard to test -#[cfg(not(tarpaulin_include))] -impl<Guard: Hash, Key> Hash for IteratorGuard<'_, Guard, Key> { - fn hash<H: std::hash::Hasher>(&self, state: &mut H) { - self.guard.hash(state) - } -} - -// No implementations of Eq, PartialEq, PartialOrd, or Ord -// You can't implement both PartialEq<Self> and PartialEq<T> -// It's easier to just implement neither and ask users to dereference -// This is less of a problem when using the scoped lock API - -#[mutants::skip] -#[cfg(not(tarpaulin_include))] -impl<Guard: Debug, Key> Debug for IteratorGuard<'_, Guard, Key> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - Debug::fmt(&**self, f) - } -} - -impl<Guard: Display, Key> Display for IteratorGuard<'_, Guard, Key> { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - Display::fmt(&**self, f) - } -} - -impl<Guard, Key> Deref for IteratorGuard<'_, Guard, Key> { - type Target = Guard; - - fn deref(&self) -> &Self::Target { - &self.guard - } -} - -impl<Guard, Key> DerefMut for IteratorGuard<'_, Guard, Key> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.guard - } -} - -impl<Guard, Key> AsRef<Guard> for IteratorGuard<'_, Guard, Key> { - fn as_ref(&self) -> &Guard { - &self.guard - } -} - -impl<Guard, Key> AsMut<Guard> for IteratorGuard<'_, Guard, Key> { - fn as_mut(&mut self) -> &mut Guard { - &mut self.guard - } -} |
