From f6b38f7425a3183214dae79445446b042154688f Mon Sep 17 00:00:00 2001 From: Botahamec Date: Wed, 5 Feb 2025 20:31:00 -0500 Subject: Tests and optimization --- src/rwlock/read_lock.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/rwlock/read_lock.rs') diff --git a/src/rwlock/read_lock.rs b/src/rwlock/read_lock.rs index 5ac0bbb..5dd83a7 100644 --- a/src/rwlock/read_lock.rs +++ b/src/rwlock/read_lock.rs @@ -34,6 +34,7 @@ unsafe impl Sharable for ReadLock<'_, T, R> } #[mutants::skip] +#[cfg(not(tarpaulin_include))] impl Debug for ReadLock<'_, T, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { // safety: this is just a try lock, and the value is dropped @@ -108,7 +109,7 @@ impl ReadLock<'_, T, R> { /// use happylock::rwlock::ReadLock; /// /// let key = ThreadKey::get().unwrap(); - /// let lock: &'static mut RwLock<_> = Box::leak(Box::new(RwLock::new(1))); + /// let lock: RwLock<_> = RwLock::new(1); /// let reader = ReadLock::new(&lock); /// /// let n = reader.lock(key); -- cgit v1.2.3