Deprecate redundant lint option_map_or_err_ok
and take manual_ok_or
out of pedantic
#14027
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While extending the
option_map_or_err_ok
lint (warn by default, "style") to recognize η-expanded forms ofOk
, as inI discovered that the
manual_ok_or
lint (allow by default, "pedantic") already covered exactly the cases handled byoption_map_or_err_ok
, including the one I was adding. Apparently,option_map_or_err_ok
was added without realizing that the lint already existed under themanual_ok_or
name. As a matter of fact, artifacts of this second lint were even present in the first lintstderr
file and went unnoticed for more than a year.This PR:
option_map_or_err_ok
with a message saying to usemanual_ok_or
manual_ok_or
from "pedantic" to "style" (the category in whichoption_map_or_err_ok
was)In addition, I think that this lint, which is short, machine applicable, and leads to shorter and clearer code with less arguments (
Ok
disappears) and the removal of one level of call (Err(x)
is replaced byx
), is a reason by itself to be in "style".changelog: [
option_map_or_err_ok
andmanual_ok_or
]: movemanual_ok_or
from "pedantic" to "style", and deprecate the redundant style lintoption_map_or_err_ok
.