Allow unreachable patterns in generated matches.

This commit is contained in:
Alex Burka 2017-07-25 19:28:34 -04:00 committed by Sergio Benitez
parent 5f0583eb04
commit 02794db2cd
1 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,7 @@ impl RouteGenerateExt for RouteParams {
let $name: $ty = {
let mut items = ::rocket::request::FormItems::from($form_string);
let form = ::rocket::request::FromForm::from_form(items.by_ref(), true);
#[allow(unreachable_patterns)]
let obj = match form {
Ok(v) => v,
Err(_) => return ::rocket::Outcome::Forward(__data)
@ -162,6 +163,7 @@ impl RouteGenerateExt for RouteParams {
let original_ident = param.ident();
fn_param_statements.push(quote_stmt!(ecx,
#[allow(unreachable_patterns)]
let $ident: $ty = match $expr {
Ok(v) => v,
Err(e) => {