diff --git a/lapin/src/config.rs b/lapin/src/config.rs index db53229..d1061c5 100644 --- a/lapin/src/config.rs +++ b/lapin/src/config.rs @@ -44,7 +44,7 @@ pub struct Config { } pub(crate) struct ConnProps<'a>(pub(crate) &'a lapin::ConnectionProperties); -impl<'a> std::fmt::Debug for ConnProps<'a> { +impl std::fmt::Debug for ConnProps<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("ConnectionProperties") .field("locale", &self.0.locale) diff --git a/postgres/src/lib.rs b/postgres/src/lib.rs index ec141ec..7aac5cb 100644 --- a/postgres/src/lib.rs +++ b/postgres/src/lib.rs @@ -552,7 +552,7 @@ impl<'a> Transaction<'a> { } } -impl<'a> fmt::Debug for Transaction<'a> { +impl fmt::Debug for Transaction<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Transaction") //.field("txn", &self.txn) @@ -636,7 +636,7 @@ impl<'a> TransactionBuilder<'a> { } } -impl<'a> fmt::Debug for TransactionBuilder<'a> { +impl fmt::Debug for TransactionBuilder<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("TransactionBuilder") //.field("builder", &self.builder) @@ -653,7 +653,7 @@ impl<'a> Deref for TransactionBuilder<'a> { } } -impl<'a> DerefMut for TransactionBuilder<'a> { +impl DerefMut for TransactionBuilder<'_> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.builder } diff --git a/redis/tests/redis_cluster.rs b/redis/tests/redis_cluster.rs index f200edf..a73b6aa 100644 --- a/redis/tests/redis_cluster.rs +++ b/redis/tests/redis_cluster.rs @@ -57,7 +57,7 @@ async fn test_read_from_replicas() { use deadpool_redis::redis::pipe; let mut cfg = Config::from_env(); cfg.redis_cluster.read_from_replicas = true; - assert_eq!(cfg.redis_cluster.read_from_replicas, true); + assert!(cfg.redis_cluster.read_from_replicas); let pool = cfg .redis_cluster diff --git a/redis/tests/redis_sentinel.rs b/redis/tests/redis_sentinel.rs index 2037634..acf5e81 100644 --- a/redis/tests/redis_sentinel.rs +++ b/redis/tests/redis_sentinel.rs @@ -187,13 +187,13 @@ async fn test_recycled_with_watch() { .unwrap(); } - let get_pipe = pipe() + let _get_pipe = pipe() .atomic() .get("key2") .query_async::(&mut txn_conn) .await .unwrap(); - let get = cmd("GET") + let _get = cmd("GET") .arg("key2") .query_async::(&mut txn_conn) .await diff --git a/src/managed/mod.rs b/src/managed/mod.rs index dd3373a..1450ea2 100644 --- a/src/managed/mod.rs +++ b/src/managed/mod.rs @@ -151,16 +151,16 @@ struct UnreadyObject<'a, M: Manager> { pool: &'a PoolInner, } -impl<'a, M: Manager> UnreadyObject<'a, M> { +impl UnreadyObject<'_, M> { fn ready(mut self) -> ObjectInner { self.inner.take().unwrap() } fn inner(&mut self) -> &mut ObjectInner { - return self.inner.as_mut().unwrap(); + self.inner.as_mut().unwrap() } } -impl<'a, M: Manager> Drop for UnreadyObject<'a, M> { +impl Drop for UnreadyObject<'_, M> { fn drop(&mut self) { if let Some(mut inner) = self.inner.take() { self.pool.slots.lock().unwrap().size -= 1; diff --git a/sync/src/lib.rs b/sync/src/lib.rs index b6a6831..5aeba7f 100644 --- a/sync/src/lib.rs +++ b/sync/src/lib.rs @@ -176,26 +176,26 @@ where #[derive(Debug)] pub struct SyncGuard<'a, T: Send>(MutexGuard<'a, Option>); -impl<'a, T: Send> Deref for SyncGuard<'a, T> { +impl Deref for SyncGuard<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { self.0.as_ref().unwrap() } } -impl<'a, T: Send> DerefMut for SyncGuard<'a, T> { +impl DerefMut for SyncGuard<'_, T> { fn deref_mut(&mut self) -> &mut Self::Target { self.0.as_mut().unwrap() } } -impl<'a, T: Send> AsRef for SyncGuard<'a, T> { +impl AsRef for SyncGuard<'_, T> { fn as_ref(&self) -> &T { self.0.as_ref().unwrap() } } -impl<'a, T: Send> AsMut for SyncGuard<'a, T> { +impl AsMut for SyncGuard<'_, T> { fn as_mut(&mut self) -> &mut T { self.0.as_mut().unwrap() }