simplify code

This commit is contained in:
Dietmar Maurer 2018-11-14 11:38:26 +01:00
parent 324a5bd095
commit 2c10fd5cb1

View File

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