fix(clippy): Switch to using or_else when we get a str parse error
This commit is contained in:
parent
8087b7cec6
commit
77edd8e544
@ -154,7 +154,9 @@ impl<
|
||||
fn visit_str<E>(&mut self, v: &str) -> Result<T, E>
|
||||
where E: Error,
|
||||
{
|
||||
str::FromStr::from_str(v.trim()).or(Err(Error::type_mismatch(Type::Str)))
|
||||
str::FromStr::from_str(v.trim()).or_else(|_| {
|
||||
Err(Error::type_mismatch(Type::Str))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user