-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
If you match on Err(_)
then it triggers the match_wild_err_arm
lint and clippy tells you to match on each error individually, but if you match on Err(_e)
it doesn't trigger at all, even though that's ignoring all possible errors just the same.
Code that brought this up
#[inline]
#[must_use]
pub fn from_array_len(data: A, len: usize) -> Self {
match Self::try_from_array_len(data, len) {
Ok(out) => out,
Err(_) => {
panic!("ArrayishVec: length {} exceeds capacity {}!", len, A::CAPACITY)
}
}
}
- This should probably only trigger on enum errors, not struct errors.
- Using a name other than
_
will still match on everything, which is what this lint theoretically doesn't link, so alternate names should also still trigger the lint
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy