Skip to content

Commit

Permalink
remove redundant lifetime bound
Browse files Browse the repository at this point in the history
  • Loading branch information
fakeshadow committed Oct 6, 2024
1 parent 033e2f9 commit 2567d57
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions postgres/src/execute/async_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where

impl<'c, C> Execute<&'c C> for StatementNamed<'_>
where
C: Prepare + 'c,
C: Prepare,
{
type ExecuteOutput = ResultFuture<IntoGuardedFuture<'c, C>>;
type QueryOutput = Self::ExecuteOutput;
Expand Down Expand Up @@ -117,7 +117,7 @@ where

impl<'c, C, P> Execute<&'c C> for StatementUnnamedBind<'_, P>
where
C: Prepare + 'c,
C: Prepare,
P: AsParams,
{
type ExecuteOutput = ResultFuture<RowAffected>;
Expand All @@ -138,7 +138,7 @@ where

impl<'c, C> Execute<&'c C> for &std::path::Path
where
C: Query + Sync + 'c,
C: Query + Sync,
{
type ExecuteOutput = BoxedFuture<'c, Result<u64, Error>>;
type QueryOutput = BoxedFuture<'c, Result<RowSimpleStream, Error>>;
Expand Down
4 changes: 2 additions & 2 deletions postgres/src/execute/sync_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ where

impl<'c, C> ExecuteBlocking<&'c C> for StatementNamed<'_>
where
C: Prepare + 'c,
C: Prepare,
{
type ExecuteOutput = Result<StatementGuarded<'c, C>, Error>;
type QueryOutput = Self::ExecuteOutput;
Expand Down Expand Up @@ -90,7 +90,7 @@ where

impl<'c, C, P> ExecuteBlocking<&'c C> for StatementUnnamedBind<'_, P>
where
C: Prepare + 'c,
C: Prepare,
P: AsParams,
{
type ExecuteOutput = Result<u64, Error>;
Expand Down
3 changes: 2 additions & 1 deletion postgres/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Pool {

/// try to get a connection from pool.
/// when pool is empty it will try to spawn new connection to database and if the process failed the outcome will
/// return as [Error]
/// return as [`Error`]
pub async fn get(&self) -> Result<PoolConnection<'_>, Error> {
let _permit = self.permits.acquire().await.expect("Semaphore must not be closed");
let conn = match self.conn.lock().unwrap().pop_front() {
Expand All @@ -94,6 +94,7 @@ impl Pool {
})
}

#[cold]
#[inline(never)]
fn connect(&self) -> BoxedFuture<'_, Result<PoolClient, Error>> {
Box::pin(async move {
Expand Down

0 comments on commit 2567d57

Please sign in to comment.