Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bikeshedder committed Dec 19, 2024
1 parent 7b2f616 commit eb8b0e0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lapin/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions postgres/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion redis/tests/redis_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions redis/tests/redis_sentinel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ async fn test_recycled_with_watch() {
.unwrap();
}

let get_pipe = pipe()
let _get_pipe = pipe()
.atomic()
.get("key2")
.query_async::<Value>(&mut txn_conn)
.await
.unwrap();
let get = cmd("GET")
let _get = cmd("GET")
.arg("key2")
.query_async::<Value>(&mut txn_conn)
.await
Expand Down
6 changes: 3 additions & 3 deletions src/managed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ struct UnreadyObject<'a, M: Manager> {
pool: &'a PoolInner<M>,
}

impl<'a, M: Manager> UnreadyObject<'a, M> {
impl<M: Manager> UnreadyObject<'_, M> {
fn ready(mut self) -> ObjectInner<M> {
self.inner.take().unwrap()
}
fn inner(&mut self) -> &mut ObjectInner<M> {
return self.inner.as_mut().unwrap();
self.inner.as_mut().unwrap()
}
}

impl<'a, M: Manager> Drop for UnreadyObject<'a, M> {
impl<M: Manager> Drop for UnreadyObject<'_, M> {
fn drop(&mut self) {
if let Some(mut inner) = self.inner.take() {
self.pool.slots.lock().unwrap().size -= 1;
Expand Down
8 changes: 4 additions & 4 deletions sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,26 @@ where
#[derive(Debug)]
pub struct SyncGuard<'a, T: Send>(MutexGuard<'a, Option<T>>);

impl<'a, T: Send> Deref for SyncGuard<'a, T> {
impl<T: Send> 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<T: Send> DerefMut for SyncGuard<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.0.as_mut().unwrap()
}
}

impl<'a, T: Send> AsRef<T> for SyncGuard<'a, T> {
impl<T: Send> AsRef<T> for SyncGuard<'_, T> {
fn as_ref(&self) -> &T {
self.0.as_ref().unwrap()
}
}

impl<'a, T: Send> AsMut<T> for SyncGuard<'a, T> {
impl<T: Send> AsMut<T> for SyncGuard<'_, T> {
fn as_mut(&mut self) -> &mut T {
self.0.as_mut().unwrap()
}
Expand Down

0 comments on commit eb8b0e0

Please sign in to comment.