From a4625296cb98a68a590ae1aa78b07f190a850f37 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Tue, 21 May 2024 13:39:57 -0400 Subject: fix errors --- src/rwlock/write_lock.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rwlock/write_lock.rs') diff --git a/src/rwlock/write_lock.rs b/src/rwlock/write_lock.rs index a344125..1f7112a 100644 --- a/src/rwlock/write_lock.rs +++ b/src/rwlock/write_lock.rs @@ -21,15 +21,15 @@ impl Debug for WriteLock { } } - f.debug_struct("ReadLock") + f.debug_struct("WriteLock") .field("data", &LockedPlaceholder) .finish() } } } -impl From> for WriteLock { - fn from(value: RwLock) -> Self { +impl<'l, T, R> From<&'l RwLock> for WriteLock<'l, T, R> { + fn from(value: &'l RwLock) -> Self { Self::new(value) } } @@ -40,7 +40,7 @@ impl AsRef> for WriteLock { } } -impl WriteLock { +impl<'l, T, R> WriteLock<'l, T, R> { /// Creates a new `WriteLock` which accesses the given [`RwLock`] /// /// # Examples @@ -52,7 +52,7 @@ impl WriteLock { /// let write_lock = WriteLock::new(&lock); /// ``` #[must_use] - pub const fn new(rwlock: RwLock) -> Self { + pub const fn new(rwlock: &'l RwLock) -> Self { Self(rwlock) } } -- cgit v1.2.3