✨ Updated dependencies, nix shell, justfile
- Updated all dependencies - Updated Rust edition to 2024 - Nix shell from flake - Added justfile - Mirgrate all changes to various packages
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use {
|
||||
axum::{
|
||||
extract::Request, handler::Handler, response::IntoResponse, routing::Route, Router,
|
||||
ServiceExt,
|
||||
Router, ServiceExt, extract::Request, handler::Handler, response::IntoResponse,
|
||||
routing::Route,
|
||||
},
|
||||
std::{
|
||||
convert::Infallible,
|
||||
@ -9,14 +9,14 @@ use {
|
||||
net::{IpAddr, Ipv4Addr, SocketAddr},
|
||||
},
|
||||
tokio::net::TcpListener,
|
||||
tower::{layer::Layer, Service},
|
||||
tower::{Service, layer::Layer},
|
||||
tower_http::{
|
||||
cors::CorsLayer,
|
||||
normalize_path::NormalizePathLayer,
|
||||
trace,
|
||||
trace::{HttpMakeClassifier, TraceLayer},
|
||||
},
|
||||
tracing::{info, Level},
|
||||
tracing::{Level, info},
|
||||
};
|
||||
|
||||
// TODO trim trailing slash into macro > let _app = NormalizePathLayer::trim_trailing_slash().layer(create_app!(routes));
|
||||
@ -69,8 +69,8 @@ impl AppBuilder {
|
||||
/// Adds a layer to the previously added routes
|
||||
pub fn layer<L>(mut self, layer: L) -> Self
|
||||
where
|
||||
L: Layer<Route> + Clone + Send + 'static,
|
||||
L::Service: Service<Request> + Clone + Send + 'static,
|
||||
L: Layer<Route> + Clone + Send + Sync + 'static,
|
||||
L::Service: Service<Request> + Clone + Send + Sync + 'static,
|
||||
<L::Service as Service<Request>>::Response: IntoResponse + 'static,
|
||||
<L::Service as Service<Request>>::Error: Into<Infallible> + 'static,
|
||||
<L::Service as Service<Request>>::Future: Send + 'static,
|
||||
|
@ -1,8 +1,7 @@
|
||||
use axum::{
|
||||
async_trait,
|
||||
extract::{
|
||||
multipart::{Field, MultipartError, MultipartRejection},
|
||||
FromRequest, Multipart, Request,
|
||||
multipart::{Field, MultipartError, MultipartRejection},
|
||||
},
|
||||
response::IntoResponse,
|
||||
};
|
||||
@ -110,7 +109,6 @@ impl IntoResponse for MultipartFileRejection {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for MultipartFile
|
||||
where
|
||||
S: Send + Sync,
|
||||
@ -142,7 +140,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for MultipartFiles
|
||||
where
|
||||
S: Send + Sync,
|
||||
@ -178,7 +175,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
async fn get_files<'a>(mut multipart: Multipart) -> Result<Vec<File>, MultipartFileRejection> {
|
||||
async fn get_files(mut multipart: Multipart) -> Result<Vec<File>, MultipartFileRejection> {
|
||||
let mut files = vec![];
|
||||
while let Some(field) = multipart.next_field().await? {
|
||||
files.push(File::from_field(field).await?);
|
||||
|
Reference in New Issue
Block a user