From 6f6e030ea7edb9d155ebf21b5d42936c20801b50 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 16 Aug 2026 12:43:05 -0400 Subject: Implement LockContext --- src/iterator/consumed_guard.rs | 58 ------------------------------------------ 1 file changed, 58 deletions(-) delete mode 100644 src/iterator/consumed_guard.rs (limited to 'src/iterator/consumed_guard.rs') diff --git a/src/iterator/consumed_guard.rs b/src/iterator/consumed_guard.rs deleted file mode 100644 index 5331289..0000000 --- a/src/iterator/consumed_guard.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::fmt::{Debug, Display}; -use std::hash::Hash; -use std::ops::{Deref, DerefMut}; - -use crate::iterator::ConsumedIteratorGuard; - -#[mutants::skip] // hashing involves RNG and is hard to test -#[cfg(not(tarpaulin_include))] -impl Hash for ConsumedIteratorGuard { - fn hash(&self, state: &mut H) { - self.guard.hash(state) - } -} - -// No implementations of Eq, PartialEq, PartialOrd, or Ord -// You can't implement both PartialEq and PartialEq -// 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 Debug for ConsumedIteratorGuard { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - Debug::fmt(&**self, f) - } -} - -impl Display for ConsumedIteratorGuard { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - Display::fmt(&**self, f) - } -} - -impl Deref for ConsumedIteratorGuard { - type Target = Guard; - - fn deref(&self) -> &Self::Target { - &self.guard - } -} - -impl DerefMut for ConsumedIteratorGuard { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.guard - } -} - -impl AsRef for ConsumedIteratorGuard { - fn as_ref(&self) -> &Guard { - &self.guard - } -} - -impl AsMut for ConsumedIteratorGuard { - fn as_mut(&mut self) -> &mut Guard { - &mut self.guard - } -} -- cgit v1.3.1