✨ Replaced async_trait with async in traits from 2024 edition
This commit is contained in:
@ -1,14 +1,13 @@
|
||||
use {
|
||||
crate::{serde::response::BaseResponse, serde::traits::DeserializeInto},
|
||||
async_trait::async_trait,
|
||||
axum::{
|
||||
Json,
|
||||
body::to_bytes,
|
||||
response::{IntoResponse, Response},
|
||||
Json,
|
||||
},
|
||||
serde::{
|
||||
de::{DeserializeOwned, Error},
|
||||
Serialize,
|
||||
de::{DeserializeOwned, Error},
|
||||
},
|
||||
};
|
||||
|
||||
@ -18,7 +17,6 @@ impl<T: Serialize> IntoResponse for BaseResponse<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl DeserializeInto for Response {
|
||||
async fn deserialize_into<T: DeserializeOwned>(self) -> Result<T, serde_json::Error> {
|
||||
let body = to_bytes(self.into_body(), usize::MAX).await.map_err(|e| {
|
||||
|
@ -13,8 +13,8 @@
|
||||
/// use lib::router;
|
||||
/// async fn simplify(path: axum::extract::path::Path<String>) {}
|
||||
/// router!("/simplify", lib::routes!(
|
||||
/// get "/:exp" => simplify,
|
||||
/// get "/table/:exp" => || async {}
|
||||
/// get "/{exp}" => simplify,
|
||||
/// get "/table/{exp}" => async || {}
|
||||
/// ));
|
||||
/// ```
|
||||
#[macro_export]
|
||||
@ -92,8 +92,8 @@ macro_rules! join_routes {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use axum::extract::State;
|
||||
use axum::Router;
|
||||
use axum::extract::State;
|
||||
|
||||
async fn index() {}
|
||||
|
||||
|
Reference in New Issue
Block a user