Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
cssivision committed Apr 27, 2024
1 parent a3f40f1 commit 5334475
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/bin/http2socks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ impl ManageConnection for SocksManager {
///
/// A standard implementation would check if a simple query like `PING` succee,
/// if the `Connection` is broken, error should return.
async fn check(&self, conn: &mut Self::Connection) -> io::Result<()> {
async fn check(&self, _conn: &mut Self::Connection) -> io::Result<()> {
Ok(())
}
}
Expand Down
12 changes: 4 additions & 8 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ where
Builder::new()
}

fn interval<'a>(&'a self) -> MutexGuard<'a, PoolInternals<M::Connection>> {
fn interval(&self) -> MutexGuard<'_, PoolInternals<M::Connection>> {
self.0.intervals.lock().unwrap()
}

Expand Down Expand Up @@ -318,11 +318,7 @@ where

fn exceed_limit(&self) -> bool {
let max_size = self.0.max_size;
if max_size > 0 && self.interval().active > max_size {
true
} else {
false
}
max_size > 0 && self.interval().active > max_size
}

/// Retrieves a connection from the pool.
Expand Down Expand Up @@ -378,14 +374,14 @@ where
e
})?;

return Ok(Connection {
Ok(Connection {
conn: Some(IdleConn {
conn,
last_visited: Instant::now(),
created: Instant::now(),
}),
pool: self.clone(),
});
})
}

fn put(&mut self, mut conn: IdleConn<M::Connection>) {
Expand Down

0 comments on commit 5334475

Please sign in to comment.