diff --git a/postgres/src/driver/codec/encode.rs b/postgres/src/driver/codec/encode.rs index 10927b64..a42cb9b2 100644 --- a/postgres/src/driver/codec/encode.rs +++ b/postgres/src/driver/codec/encode.rs @@ -72,13 +72,13 @@ impl<'s> Encode for &'s Statement { } } -impl sealed::Sealed for StatementCreate<'_, C> {} +impl sealed::Sealed for StatementCreate<'_, '_, C> {} -impl<'s, C> Encode for StatementCreate<'s, C> +impl<'c, C> Encode for StatementCreate<'_, 'c, C> where C: Prepare, { - type Output = StatementCreateResponse<'s, C>; + type Output = StatementCreateResponse<'c, C>; #[inline] fn encode(self, buf: &mut BytesMut) -> Result { @@ -87,13 +87,13 @@ where } } -impl sealed::Sealed for StatementCreateBlocking<'_, C> {} +impl sealed::Sealed for StatementCreateBlocking<'_, '_, C> {} -impl<'s, C> Encode for StatementCreateBlocking<'s, C> +impl<'c, C> Encode for StatementCreateBlocking<'_, 'c, C> where C: Prepare, { - type Output = StatementCreateResponseBlocking<'s, C>; + type Output = StatementCreateResponseBlocking<'c, C>; #[inline] fn encode(self, buf: &mut BytesMut) -> Result { @@ -147,14 +147,14 @@ where } } -impl sealed::Sealed for StatementUnnamedQuery<'_, P, C> {} +impl sealed::Sealed for StatementUnnamedQuery<'_, '_, P, C> {} -impl<'s, C, P> Encode for StatementUnnamedQuery<'s, P, C> +impl<'c, C, P> Encode for StatementUnnamedQuery<'_, 'c, P, C> where C: Prepare, P: AsParams, { - type Output = IntoRowStreamGuard<'s, C>; + type Output = IntoRowStreamGuard<'c, C>; #[inline] fn encode(self, buf: &mut BytesMut) -> Result { diff --git a/postgres/src/execute/async_impl.rs b/postgres/src/execute/async_impl.rs index a976a49b..db76e9b0 100644 --- a/postgres/src/execute/async_impl.rs +++ b/postgres/src/execute/async_impl.rs @@ -76,10 +76,9 @@ where } } -impl<'c, 's, C> Execute<'c, C> for StatementNamed<'s> +impl<'c, C> Execute<'c, C> for StatementNamed<'_> where C: Prepare + 'c, - 's: 'c, { type ExecuteOutput = ResultFuture>; type QueryOutput = Self::ExecuteOutput; @@ -116,11 +115,10 @@ where } } -impl<'s, 'c, C, P> Execute<'c, C> for StatementUnnamedBind<'s, P> +impl<'c, C, P> Execute<'c, C> for StatementUnnamedBind<'_, P> where C: Prepare + 'c, P: AsParams, - 's: 'c, { type ExecuteOutput = ResultFuture; type QueryOutput = Ready, Error>>; diff --git a/postgres/src/execute/sync_impl.rs b/postgres/src/execute/sync_impl.rs index b39403ce..68b17d8e 100644 --- a/postgres/src/execute/sync_impl.rs +++ b/postgres/src/execute/sync_impl.rs @@ -49,10 +49,9 @@ where } } -impl<'c, 's, C> ExecuteBlocking<'c, C> for StatementNamed<'s> +impl<'c, C> ExecuteBlocking<'c, C> for StatementNamed<'_> where C: Prepare + 'c, - 's: 'c, { type ExecuteOutput = Result, Error>; type QueryOutput = Self::ExecuteOutput; @@ -72,7 +71,7 @@ where impl<'s, C, P> ExecuteBlocking<'_, C> for StatementQuery<'s, P> where C: Query, - P: AsParams + 's, + P: AsParams, { type ExecuteOutput = Result; type QueryOutput = Result, Error>; @@ -89,11 +88,10 @@ where } } -impl<'s, 'c, C, P> ExecuteBlocking<'c, C> for StatementUnnamedBind<'s, P> +impl<'c, C, P> ExecuteBlocking<'c, C> for StatementUnnamedBind<'_, P> where C: Prepare + 'c, - P: AsParams + 'c, - 's: 'c, + P: AsParams, { type ExecuteOutput = Result; type QueryOutput = Result, Error>; diff --git a/postgres/src/statement.rs b/postgres/src/statement.rs index 29fc9f8d..a1832731 100644 --- a/postgres/src/statement.rs +++ b/postgres/src/statement.rs @@ -195,15 +195,15 @@ impl StatementNamed<'_> { } } -pub(crate) struct StatementCreate<'a, C> { +pub(crate) struct StatementCreate<'a, 'c, C> { pub(crate) name: String, pub(crate) stmt: &'a str, pub(crate) types: &'a [Type], - pub(crate) cli: &'a C, + pub(crate) cli: &'c C, } -impl<'a, C> From<(StatementNamed<'a>, &'a C)> for StatementCreate<'a, C> { - fn from((stmt, cli): (StatementNamed<'a>, &'a C)) -> Self { +impl<'a, 'c, C> From<(StatementNamed<'a>, &'c C)> for StatementCreate<'a, 'c, C> { + fn from((stmt, cli): (StatementNamed<'a>, &'c C)) -> Self { Self { name: StatementNamed::name(), stmt: stmt.stmt, @@ -213,15 +213,15 @@ impl<'a, C> From<(StatementNamed<'a>, &'a C)> for StatementCreate<'a, C> { } } -pub(crate) struct StatementCreateBlocking<'a, C> { +pub(crate) struct StatementCreateBlocking<'a, 'c, C> { pub(crate) name: String, pub(crate) stmt: &'a str, pub(crate) types: &'a [Type], - pub(crate) cli: &'a C, + pub(crate) cli: &'c C, } -impl<'a, C> From<(StatementNamed<'a>, &'a C)> for StatementCreateBlocking<'a, C> { - fn from((stmt, cli): (StatementNamed<'a>, &'a C)) -> Self { +impl<'a, 'c, C> From<(StatementNamed<'a>, &'c C)> for StatementCreateBlocking<'a, 'c, C> { + fn from((stmt, cli): (StatementNamed<'a>, &'c C)) -> Self { Self { name: StatementNamed::name(), stmt: stmt.stmt, @@ -273,15 +273,15 @@ pub struct StatementUnnamedBind<'a, P> { params: P, } -pub(crate) struct StatementUnnamedQuery<'a, P, C> { +pub(crate) struct StatementUnnamedQuery<'a, 'c, P, C> { pub(crate) stmt: &'a str, pub(crate) types: &'a [Type], pub(crate) params: P, - pub(crate) cli: &'a C, + pub(crate) cli: &'c C, } -impl<'a, P, C> From<(StatementUnnamedBind<'a, P>, &'a C)> for StatementUnnamedQuery<'a, P, C> { - fn from((bind, cli): (StatementUnnamedBind<'a, P>, &'a C)) -> Self { +impl<'a, 'c, P, C> From<(StatementUnnamedBind<'a, P>, &'c C)> for StatementUnnamedQuery<'a, 'c, P, C> { + fn from((bind, cli): (StatementUnnamedBind<'a, P>, &'c C)) -> Self { Self { stmt: bind.stmt, types: bind.types,