Tweak lifetime

This commit is contained in:
Chris Tsang 2021-10-12 14:56:22 +08:00
parent 3a6e55ced1
commit 069040be8b
3 changed files with 6 additions and 9 deletions

View File

@ -18,7 +18,7 @@ impl<'a, A: 'a> DeleteOne<A>
where
A: ActiveModelTrait,
{
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + 'a
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + '_
where
C: ConnectionTrait<'a>,
{
@ -31,7 +31,7 @@ impl<'a, E> DeleteMany<E>
where
E: EntityTrait,
{
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + 'a
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<DeleteResult, DbErr>> + '_
where
C: ConnectionTrait<'a>,
{
@ -61,8 +61,7 @@ where
Deleter::new(query).exec(db).await
}
// Only Statement impl Send
async fn exec_delete<'a, C>(statement: Statement, db: &C) -> Result<DeleteResult, DbErr>
async fn exec_delete<'a, C>(statement: Statement, db: &'a C) -> Result<DeleteResult, DbErr>
where
C: ConnectionTrait<'a>,
{

View File

@ -28,7 +28,7 @@ where
A: ActiveModelTrait,
{
#[allow(unused_mut)]
pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + 'a
pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + '_
where
C: ConnectionTrait<'a>,
A: 'a,
@ -61,7 +61,7 @@ where
}
}
pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + 'a
pub fn exec<'a, C>(self, db: &'a C) -> impl Future<Output = Result<InsertResult<A>, DbErr>> + '_
where
C: ConnectionTrait<'a>,
A: 'a,
@ -71,7 +71,6 @@ where
}
}
// Only Statement impl Send
async fn exec_insert<'a, A, C>(
primary_key: Option<ValueTuple>,
statement: Statement,

View File

@ -32,7 +32,7 @@ impl<'a, E> UpdateMany<E>
where
E: EntityTrait,
{
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<UpdateResult, DbErr>> + 'a
pub fn exec<C>(self, db: &'a C) -> impl Future<Output = Result<UpdateResult, DbErr>> + '_
where
C: ConnectionTrait<'a>,
{
@ -83,7 +83,6 @@ where
Ok(model)
}
// Only Statement impl Send
async fn exec_update<'a, C>(
statement: Statement,
db: &'a C,