Make '<String as FromParam>::Error' 'Infallible'.

Fixes #1679.
This commit is contained in:
PROgrm_JARvis 2021-06-11 17:42:04 +03:00 committed by Sergio Benitez
parent dc1b729f29
commit 4339c2af48
2 changed files with 2 additions and 2 deletions

View File

@ -427,7 +427,7 @@ struct Third<'r> {
#[post("/<foo>/<bar>?<q1>&<rest..>")]
fn optionals(
foo: Option<usize>,
bar: Result<String, &'_ str>,
bar: Option<String>,
q1: Result<usize, Errors<'_>>,
rest: Option<Third<'_>>
) { }

View File

@ -193,7 +193,7 @@ impl<'a> FromParam<'a> for &'a str {
}
impl<'a> FromParam<'a> for String {
type Error = &'a str;
type Error = std::convert::Infallible;
#[inline(always)]
fn from_param(param: &'a str) -> Result<String, Self::Error> {