This commit is contained in:
Billy Chan 2024-12-02 13:56:27 +08:00
parent 2eb398efa9
commit 9d0f7e3917
No known key found for this signature in database
GPG Key ID: 45461E52F22E0279
5 changed files with 16 additions and 16 deletions

View File

@ -111,7 +111,7 @@ impl CaseStyleHelpers for Ident {
} }
} }
impl<'meta> TryFrom<&ParseNestedMeta<'meta>> for CaseStyle { impl TryFrom<&ParseNestedMeta<'_>> for CaseStyle {
type Error = syn::Error; type Error = syn::Error;
fn try_from(value: &ParseNestedMeta) -> Result<Self, Self::Error> { fn try_from(value: &ParseNestedMeta) -> Result<Self, Self::Error> {

View File

@ -31,7 +31,7 @@ impl<'a> MetricStream<'a> {
} }
} }
impl<'a> Stream for MetricStream<'a> { impl Stream for MetricStream<'_> {
type Item = Result<QueryResult, DbErr>; type Item = Result<QueryResult, DbErr>;
fn poll_next( fn poll_next(
@ -51,7 +51,7 @@ impl<'a> Stream for MetricStream<'a> {
} }
} }
impl<'a> Drop for MetricStream<'a> { impl Drop for MetricStream<'_> {
fn drop(&mut self) { fn drop(&mut self) {
if let (Some(callback), Some(elapsed)) = (self.metric_callback.as_deref(), self.elapsed) { if let (Some(callback), Some(elapsed)) = (self.metric_callback.as_deref(), self.elapsed) {
let info = crate::metric::Info { let info = crate::metric::Info {

View File

@ -27,20 +27,20 @@ pub struct TransactionStream<'a> {
stream: MetricStream<'this>, stream: MetricStream<'this>,
} }
impl<'a> std::fmt::Debug for TransactionStream<'a> { impl std::fmt::Debug for TransactionStream<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "TransactionStream") write!(f, "TransactionStream")
} }
} }
impl<'a> TransactionStream<'a> { impl TransactionStream<'_> {
#[instrument(level = "trace", skip(metric_callback))] #[instrument(level = "trace", skip(metric_callback))]
#[allow(unused_variables)] #[allow(unused_variables)]
pub(crate) fn build( pub(crate) fn build(
conn: MutexGuard<'a, InnerConnection>, conn: MutexGuard<'_, InnerConnection>,
stmt: Statement, stmt: Statement,
metric_callback: Option<crate::metric::Callback>, metric_callback: Option<crate::metric::Callback>,
) -> TransactionStream<'a> { ) -> TransactionStream<'_> {
TransactionStreamBuilder { TransactionStreamBuilder {
stmt, stmt,
conn, conn,
@ -98,7 +98,7 @@ impl<'a> TransactionStream<'a> {
} }
} }
impl<'a> Stream for TransactionStream<'a> { impl Stream for TransactionStream<'_> {
type Item = Result<QueryResult, DbErr>; type Item = Result<QueryResult, DbErr>;
fn poll_next( fn poll_next(

View File

@ -20,7 +20,7 @@ where
A: ActiveModelTrait, A: ActiveModelTrait,
{ {
/// Execute a DELETE operation on one ActiveModel /// Execute a DELETE operation on one ActiveModel
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + '_ pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + 'a
where where
C: ConnectionTrait, C: ConnectionTrait,
{ {
@ -34,7 +34,7 @@ where
E: EntityTrait, E: EntityTrait,
{ {
/// Execute a DELETE operation on many ActiveModels /// Execute a DELETE operation on many ActiveModels
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + '_ pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + 'a
where where
C: ConnectionTrait, C: ConnectionTrait,
{ {

View File

@ -110,7 +110,7 @@ where
{ {
/// Execute an insert operation /// Execute an insert operation
#[allow(unused_mut)] #[allow(unused_mut)]
pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + '_ pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + 'a
where where
C: ConnectionTrait, C: ConnectionTrait,
A: 'a, A: 'a,
@ -134,7 +134,7 @@ where
pub fn exec_without_returning<'a, C>( pub fn exec_without_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,
) -> impl Future<Output = Result<u64, DbErr>> + '_ ) -> impl Future<Output = Result<u64, DbErr>> + 'a
where where
<A::Entity as EntityTrait>::Model: IntoActiveModel<A>, <A::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait, C: ConnectionTrait,
@ -147,7 +147,7 @@ where
pub fn exec_with_returning<'a, C>( pub fn exec_with_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,
) -> impl Future<Output = Result<<A::Entity as EntityTrait>::Model, DbErr>> + '_ ) -> impl Future<Output = Result<<A::Entity as EntityTrait>::Model, DbErr>> + 'a
where where
<A::Entity as EntityTrait>::Model: IntoActiveModel<A>, <A::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait, C: ConnectionTrait,
@ -171,7 +171,7 @@ where
} }
/// Execute an insert operation, returning the last inserted id /// Execute an insert operation, returning the last inserted id
pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + '_ pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + 'a
where where
C: ConnectionTrait, C: ConnectionTrait,
A: 'a, A: 'a,
@ -183,7 +183,7 @@ where
pub fn exec_without_returning<'a, C>( pub fn exec_without_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,
) -> impl Future<Output = Result<u64, DbErr>> + '_ ) -> impl Future<Output = Result<u64, DbErr>> + 'a
where where
C: ConnectionTrait, C: ConnectionTrait,
A: 'a, A: 'a,
@ -195,7 +195,7 @@ where
pub fn exec_with_returning<'a, C>( pub fn exec_with_returning<'a, C>(
self, self,
db: &'a C, db: &'a C,
) -> impl Future<Output = Result<<A::Entity as EntityTrait>::Model, DbErr>> + '_ ) -> impl Future<Output = Result<<A::Entity as EntityTrait>::Model, DbErr>> + 'a
where where
<A::Entity as EntityTrait>::Model: IntoActiveModel<A>, <A::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait, C: ConnectionTrait,