diff --git a/core/lib/src/lib.rs b/core/lib/src/lib.rs index 9701aa47..43b7214f 100644 --- a/core/lib/src/lib.rs +++ b/core/lib/src/lib.rs @@ -1,7 +1,6 @@ #![feature(try_trait)] #![feature(proc_macro_hygiene)] #![feature(crate_visibility_modifier)] -#![feature(label_break_value)] #![recursion_limit="256"] diff --git a/core/lib/src/request/form/form.rs b/core/lib/src/request/form/form.rs index d3f56ed4..be4efc41 100644 --- a/core/lib/src/request/form/form.rs +++ b/core/lib/src/request/form/form.rs @@ -195,23 +195,19 @@ impl<'f, T: FromForm<'f>> FromData<'f> for Form { ) -> Transform> { use std::{cmp::min, io::Read}; - let outcome = 'o: { - if !request.content_type().map_or(false, |ct| ct.is_form()) { - warn_!("Form data does not have form content type."); - break 'o Forward(data); - } + if !request.content_type().map_or(false, |ct| ct.is_form()) { + warn_!("Form data does not have form content type."); + return Transform::Borrowed(Forward(data)) + } - let limit = request.limits().forms; - let mut stream = data.open().take(limit); - let mut form_string = String::with_capacity(min(4096, limit) as usize); - if let Err(e) = stream.read_to_string(&mut form_string) { - break 'o Failure((Status::InternalServerError, FormDataError::Io(e))); - } + let limit = request.limits().forms; + let mut stream = data.open().take(limit); + let mut form_string = String::with_capacity(min(4096, limit) as usize); + if let Err(e) = stream.read_to_string(&mut form_string) { + return Transform::Borrowed(Failure((Status::InternalServerError, FormDataError::Io(e)))) + } - break 'o Success(form_string); - }; - - Transform::Borrowed(outcome) + Transform::Borrowed(Success(form_string)) } fn from_data(_: &Request<'_>, o: Transformed<'f, Self>) -> Outcome {