Replaced async_trait with async in traits from 2024 edition

This commit is contained in:
2025-03-07 22:40:10 +01:00
parent 2f1eb4df3a
commit 5a77407297
16 changed files with 90 additions and 127 deletions

View File

@ -1,4 +1,4 @@
use crate::{common, Attributes};
use crate::{Attributes, common};
use quote::quote;
pub(crate) fn derive_diesel_crud_list_impl(
@ -13,15 +13,9 @@ pub(crate) fn derive_diesel_crud_list_impl(
quote! {
#[automatically_derived]
impl lib::diesel_crud_trait::DieselCrudList for #struct_ident {
fn list<'a, 'async_trait>(conn: &'a mut diesel_async::AsyncPgConnection) -> #return_type
where
Self: Sized + Sync + 'a,
'a: 'async_trait
{
Box::pin(async move {
use diesel::associations::HasTable;
diesel_async::RunQueryDsl::get_results(#table::table::table(), conn).await.map_err(Into::into)
})
async fn list(conn: &mut diesel_async::AsyncPgConnection) -> #return_type {
use diesel::associations::HasTable;
diesel_async::RunQueryDsl::get_results(#table::table::table(), conn).await.map_err(Into::into)
}
}
}