Lint simplifyable ok_or_else
usage
#4676
Labels
A-lint
Area: New lints
L-complexity
Lint: Belongs in the complexity lint group
L-suggestion
Lint: Improving, adding or fixing lint suggestions
The following code uses
String::from
but
Some(52.3).ok_or("foo")?;
would also compileSo if an
ok_or_else
is followed by a?
and the inner function is callingFrom::from
(or a specific version of it), we should be able to convert it to anok_or
without that call.The text was updated successfully, but these errors were encountered: