Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 2, 2024
1 parent 2eb398e commit 9d0f7e3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion sea-orm-macros/src/derives/case_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl CaseStyleHelpers for Ident {
}
}

impl<'meta> TryFrom<&ParseNestedMeta<'meta>> for CaseStyle {
impl TryFrom<&ParseNestedMeta<'_>> for CaseStyle {
type Error = syn::Error;

fn try_from(value: &ParseNestedMeta) -> Result<Self, Self::Error> {
Expand Down
4 changes: 2 additions & 2 deletions src/database/stream/metric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'a> MetricStream<'a> {
}
}

impl<'a> Stream for MetricStream<'a> {
impl Stream for MetricStream<'_> {
type Item = Result<QueryResult, DbErr>;

fn poll_next(
Expand All @@ -51,7 +51,7 @@ impl<'a> Stream for MetricStream<'a> {
}
}

impl<'a> Drop for MetricStream<'a> {
impl Drop for MetricStream<'_> {
fn drop(&mut self) {
if let (Some(callback), Some(elapsed)) = (self.metric_callback.as_deref(), self.elapsed) {
let info = crate::metric::Info {
Expand Down
10 changes: 5 additions & 5 deletions src/database/stream/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ pub struct TransactionStream<'a> {
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 {
write!(f, "TransactionStream")
}
}

impl<'a> TransactionStream<'a> {
impl TransactionStream<'_> {
#[instrument(level = "trace", skip(metric_callback))]
#[allow(unused_variables)]
pub(crate) fn build(
conn: MutexGuard<'a, InnerConnection>,
conn: MutexGuard<'_, InnerConnection>,
stmt: Statement,
metric_callback: Option<crate::metric::Callback>,
) -> TransactionStream<'a> {
) -> TransactionStream<'_> {
TransactionStreamBuilder {
stmt,
conn,
Expand Down Expand Up @@ -98,7 +98,7 @@ impl<'a> TransactionStream<'a> {
}
}

impl<'a> Stream for TransactionStream<'a> {
impl Stream for TransactionStream<'_> {
type Item = Result<QueryResult, DbErr>;

fn poll_next(
Expand Down
4 changes: 2 additions & 2 deletions src/executor/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ where
A: ActiveModelTrait,
{
/// 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
C: ConnectionTrait,
{
Expand All @@ -34,7 +34,7 @@ where
E: EntityTrait,
{
/// 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
C: ConnectionTrait,
{
Expand Down
12 changes: 6 additions & 6 deletions src/executor/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ where
{
/// Execute an insert operation
#[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
C: ConnectionTrait,
A: 'a,
Expand All @@ -134,7 +134,7 @@ where
pub fn exec_without_returning<'a, C>(
self,
db: &'a C,
) -> impl Future<Output = Result<u64, DbErr>> + '_
) -> impl Future<Output = Result<u64, DbErr>> + 'a
where
<A::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait,
Expand All @@ -147,7 +147,7 @@ where
pub fn exec_with_returning<'a, C>(
self,
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
<A::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait,
Expand All @@ -171,7 +171,7 @@ where
}

/// 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
C: ConnectionTrait,
A: 'a,
Expand All @@ -183,7 +183,7 @@ where
pub fn exec_without_returning<'a, C>(
self,
db: &'a C,
) -> impl Future<Output = Result<u64, DbErr>> + '_
) -> impl Future<Output = Result<u64, DbErr>> + 'a
where
C: ConnectionTrait,
A: 'a,
Expand All @@ -195,7 +195,7 @@ where
pub fn exec_with_returning<'a, C>(
self,
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
<A::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait,
Expand Down

0 comments on commit 9d0f7e3

Please sign in to comment.