✨ Replaced async_trait with async in traits from 2024 edition
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user