refactor forms to be more readable
This commit is contained in:
parent
0cdf8fe7fc
commit
c1220cac79
|
@ -249,9 +249,10 @@ pub async fn upload(form: FormData, state: SharedState) -> Result<Box<dyn Reply>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_routes(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
|
pub fn get_routes(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
|
||||||
warp::post().and(
|
warp::post()
|
||||||
warp::multipart::form()
|
.and(warp::multipart::form())
|
||||||
.and(warp::any().map(move || state.clone()))
|
.and(
|
||||||
.and_then(upload)
|
warp::any().map(move || state.clone())
|
||||||
)
|
)
|
||||||
|
.and_then(upload)
|
||||||
}
|
}
|
Loading…
Reference in New Issue