From 2c10fd5cb185f22ed58c0530d214693c073201fd Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 14 Nov 2018 11:38:26 +0100 Subject: [PATCH] simplify code --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7447744f..443bcef4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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| {