Use 'unreachable' to silence clippy on route codegen.

Closes #794.
This commit is contained in:
Sergio Benitez 2018-10-29 01:32:52 -07:00
parent d5fec97fcb
commit 7090e2a1ee
2 changed files with 6 additions and 4 deletions

View File

@ -32,4 +32,4 @@ rev = "62f361f"
[dev-dependencies]
rocket = { version = "0.4.0-dev", path = "../lib" }
compiletest_rs = { version = "0.3", features = ["stable"] }
compiletest_rs = { git = "https://github.com/laumann/compiletest-rs" }

View File

@ -180,9 +180,11 @@ fn data_expr(ident: &syn::Ident, ty: &syn::Type) -> TokenStream2 {
Owned(Outcome::Success(__v)) => Owned(Outcome::Success(__v)),
Borrowed(Outcome::Success(ref __v)) => {
Borrowed(Outcome::Success(::std::borrow::Borrow::borrow(__v)))
}
Borrowed(__o) => Borrowed(__o.map(|_| loop { /* unreachable */ })),
Owned(__o) => Owned(__o)
},
Borrowed(__o) => Borrowed(__o.map(|_| {
unreachable!("Borrowed(Success(..)) case handled in previous block")
})),
Owned(__o) => Owned(__o),
};
#[allow(non_snake_case, unreachable_patterns, unreachable_code)]