-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
A-user-storyArea: A user story or a related issueArea: A user story or a related issue
Description
Lint explanation
Detect code that uses let _ = result.map_err(); pattern instead of if-let. The reasoning is that map_err is meant for changing the error type of the result, so it does more than just inspecting the error result. if-let intentionally ignores any values that don't match the pattern and is subjectively clearer, and objectively shorter.
Example code
Bad
let _ = do_something_fallible().map_err(|err| {
// log the error
});Good
if let Err(err) = do_something_fallible() {
// log the error
}Metadata
Metadata
Assignees
Labels
A-user-storyArea: A user story or a related issueArea: A user story or a related issue