summaryrefslogtreecommitdiff
path: root/src/rwlock/read_lock.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2024-05-21 13:18:10 -0400
committerBotahamec <botahamec@outlook.com>2024-05-21 13:18:10 -0400
commit6e3aa5182604b30ef75ba5676e9f677cc1d18fe3 (patch)
treed8e23a82c8151c4b49c15f49707d96651764db39 /src/rwlock/read_lock.rs
parent875d5c4ad6e0c2a78c15476584fc686121b340d3 (diff)
parentc344021797b7e1f8027bd9d1302908f0767e362b (diff)
Merge remote-tracking branch 'origin/0.2' into 0.2
Diffstat (limited to 'src/rwlock/read_lock.rs')
-rw-r--r--src/rwlock/read_lock.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rwlock/read_lock.rs b/src/rwlock/read_lock.rs
index 133ca7d..a8bb9be 100644
--- a/src/rwlock/read_lock.rs
+++ b/src/rwlock/read_lock.rs
@@ -6,7 +6,7 @@ use crate::key::Keyable;
use super::{ReadLock, RwLock, RwLockReadGuard, RwLockReadRef};
-impl<'a, T: ?Sized + Debug, R: RawRwLock> Debug for ReadLock<'a, T, R> {
+impl<T: ?Sized + Debug, R: RawRwLock> 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
// immediately after, so there's no risk of blocking ourselves
@@ -28,19 +28,19 @@ impl<'a, T: ?Sized + Debug, R: RawRwLock> Debug for ReadLock<'a, T, R> {
}
}
-impl<'a, T: ?Sized, R> From<&'a RwLock<T, R>> for ReadLock<'a, T, R> {
- fn from(value: &'a RwLock<T, R>) -> Self {
+impl<T, R> From<RwLock<T, R>> for ReadLock<T, R> {
+ fn from(value: RwLock<T, R>) -> Self {
Self::new(value)
}
}
-impl<'a, T: ?Sized, R> AsRef<RwLock<T, R>> for ReadLock<'a, T, R> {
+impl<T: ?Sized, R> AsRef<RwLock<T, R>> for ReadLock<T, R> {
fn as_ref(&self) -> &RwLock<T, R> {
- self.0
+ &self.0
}
}
-impl<'a, T: ?Sized, R> ReadLock<'a, T, R> {
+impl<T, R> ReadLock<T, R> {
/// Creates a new `ReadLock` which accesses the given [`RwLock`]
///
/// # Examples
@@ -52,12 +52,12 @@ impl<'a, T: ?Sized, R> ReadLock<'a, T, R> {
/// let read_lock = ReadLock::new(&lock);
/// ```
#[must_use]
- pub const fn new(rwlock: &'a RwLock<T, R>) -> Self {
+ pub const fn new(rwlock: RwLock<T, R>) -> Self {
Self(rwlock)
}
}
-impl<'a, T: ?Sized, R: RawRwLock> ReadLock<'a, T, R> {
+impl<T: ?Sized, R: RawRwLock> ReadLock<T, R> {
/// Locks the underlying [`RwLock`] with shared read access, blocking the
/// current thread until it can be acquired.
pub fn lock<'s, 'key: 's, Key: Keyable + 'key>(