simplify code

This commit is contained in:
Dietmar Maurer 2018-11-14 11:38:26 +01:00
parent 324a5bd095
commit 2c10fd5cb1
1 changed files with 2 additions and 3 deletions

View File

@ -60,10 +60,9 @@ fn get_request_parameters_async<'a>(
.fold(Vec::new(), |mut acc, chunk| { .fold(Vec::new(), |mut acc, chunk| {
if acc.len() + chunk.len() < 64*1024 { //fimxe: max request body size? if acc.len() + chunk.len() < 64*1024 { //fimxe: max request body size?
acc.extend_from_slice(&*chunk); acc.extend_from_slice(&*chunk);
future::ok(acc) Ok(acc)
} }
//else { ok(acc) } //FIXMEEEEE else { Err(Error::from(ApiError::new(StatusCode::BAD_REQUEST, format!("Request body too large")))) }
else { future::err(Error::from(ApiError::new(StatusCode::BAD_REQUEST, format!("Request body too large")))) }
}) })
.and_then(move |body| { .and_then(move |body| {