summaryrefslogtreecommitdiff
path: root/src/rwlock/read_guard.rs
diff options
context:
space:
mode:
authorMica White <botahamec@gmail.com>2024-12-26 10:54:51 -0500
committerMica White <botahamec@gmail.com>2024-12-26 11:06:23 -0500
commita060123077b94f61e3d0802a6977ad547276fd1b (patch)
tree321cfbca5d8a661085f8455f6115c5fe7499e9af /src/rwlock/read_guard.rs
parent129c13c21254ca104bddf020170edaca1fb7107d (diff)
Remove unnecessary generics
Diffstat (limited to 'src/rwlock/read_guard.rs')
-rw-r--r--src/rwlock/read_guard.rs34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/rwlock/read_guard.rs b/src/rwlock/read_guard.rs
index 45d0bd9..44b737e 100644
--- a/src/rwlock/read_guard.rs
+++ b/src/rwlock/read_guard.rs
@@ -36,19 +36,19 @@ impl<T: Hash + ?Sized, R: RawRwLock> Hash for RwLockReadRef<'_, T, R> {
}
}
-impl<'a, T: Debug + ?Sized + 'a, R: RawRwLock> Debug for RwLockReadRef<'a, T, R> {
+impl<T: Debug + ?Sized, R: RawRwLock> Debug for RwLockReadRef<'_, T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&**self, f)
}
}
-impl<'a, T: Display + ?Sized + 'a, R: RawRwLock> Display for RwLockReadRef<'a, T, R> {
+impl<T: Display + ?Sized, R: RawRwLock> Display for RwLockReadRef<'_, T, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Display::fmt(&**self, f)
}
}
-impl<'a, T: ?Sized + 'a, R: RawRwLock> Deref for RwLockReadRef<'a, T, R> {
+impl<T: ?Sized, R: RawRwLock> Deref for RwLockReadRef<'_, T, R> {
type Target = T;
fn deref(&self) -> &Self::Target {
@@ -59,13 +59,13 @@ impl<'a, T: ?Sized + 'a, R: RawRwLock> Deref for RwLockReadRef<'a, T, R> {
}
}
-impl<'a, T: ?Sized + 'a, R: RawRwLock> AsRef<T> for RwLockReadRef<'a, T, R> {
+impl<T: ?Sized, R: RawRwLock> AsRef<T> for RwLockReadRef<'_, T, R> {
fn as_ref(&self) -> &T {
self
}
}
-impl<'a, T: ?Sized + 'a, R: RawRwLock> Drop for RwLockReadRef<'a, T, R> {
+impl<T: ?Sized, R: RawRwLock> Drop for RwLockReadRef<'_, T, R> {
fn drop(&mut self) {
// safety: this guard is being destroyed, so the data cannot be
// accessed without locking again
@@ -73,7 +73,7 @@ impl<'a, T: ?Sized + 'a, R: RawRwLock> Drop for RwLockReadRef<'a, T, R> {
}
}
-impl<'a, T: ?Sized + 'a, R: RawRwLock> RwLockReadRef<'a, T, R> {
+impl<'a, T: ?Sized, R: RawRwLock> RwLockReadRef<'a, T, R> {
/// Creates an immutable reference for the underlying data of an [`RwLock`]
/// without locking it or taking ownership of the key.
#[must_use]
@@ -112,25 +112,21 @@ impl<T: Hash + ?Sized, R: RawRwLock, Key: Keyable> Hash for RwLockReadGuard<'_,
}
}
-impl<'a, 'key, T: Debug + ?Sized + 'a, Key: Keyable + 'key, R: RawRwLock> Debug
- for RwLockReadGuard<'a, 'key, T, Key, R>
-{
+impl<T: Debug + ?Sized, Key: Keyable, R: RawRwLock> Debug for RwLockReadGuard<'_, '_, T, Key, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&**self, f)
}
}
-impl<'a, 'key, T: Display + ?Sized + 'a, Key: Keyable + 'key, R: RawRwLock> Display
- for RwLockReadGuard<'a, 'key, T, Key, R>
+impl<T: Display + ?Sized, Key: Keyable, R: RawRwLock> Display
+ for RwLockReadGuard<'_, '_, T, Key, R>
{
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Display::fmt(&**self, f)
}
}
-impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Deref
- for RwLockReadGuard<'a, 'key, T, Key, R>
-{
+impl<T: ?Sized, Key: Keyable, R: RawRwLock> Deref for RwLockReadGuard<'_, '_, T, Key, R> {
type Target = T;
fn deref(&self) -> &Self::Target {
@@ -138,17 +134,13 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> Deref
}
}
-impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock> AsRef<T>
- for RwLockReadGuard<'a, 'key, T, Key, R>
-{
+impl<T: ?Sized, Key: Keyable, R: RawRwLock> AsRef<T> for RwLockReadGuard<'_, '_, T, Key, R> {
fn as_ref(&self) -> &T {
self
}
}
-impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock>
- RwLockReadGuard<'a, 'key, T, Key, R>
-{
+impl<'a, T: ?Sized, Key: Keyable, R: RawRwLock> RwLockReadGuard<'a, '_, T, Key, R> {
/// Create a guard to the given mutex. Undefined if multiple guards to the
/// same mutex exist at once.
#[must_use]
@@ -161,4 +153,4 @@ impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawRwLock>
}
}
-unsafe impl<'a, T: ?Sized + Sync + 'a, R: RawRwLock + Sync + 'a> Sync for RwLockReadRef<'a, T, R> {}
+unsafe impl<T: ?Sized + Sync, R: RawRwLock + Sync> Sync for RwLockReadRef<'_, T, R> {}