Skip to content

Commit

Permalink
Resolve clippy filter_map_next pedantic lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 30, 2020
1 parent 25f0be5 commit dc3c5c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion impl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(
clippy::blocks_in_if_conditions,
clippy::cast_possible_truncation,
clippy::filter_map_next,
clippy::map_unwrap_or,
clippy::needless_pass_by_value,
clippy::option_if_let_else,
Expand Down
4 changes: 2 additions & 2 deletions impl/src/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Struct<'_> {
"#[error(transparent)] requires exactly one field",
));
}
if let Some(source) = self.fields.iter().filter_map(|f| f.attrs.source).next() {
if let Some(source) = self.fields.iter().find_map(|f| f.attrs.source) {
return Err(Error::new_spanned(
source,
"transparent error struct can't contain #[source]",
Expand Down Expand Up @@ -78,7 +78,7 @@ impl Variant<'_> {
"#[error(transparent)] requires exactly one field",
));
}
if let Some(source) = self.fields.iter().filter_map(|f| f.attrs.source).next() {
if let Some(source) = self.fields.iter().find_map(|f| f.attrs.source) {
return Err(Error::new_spanned(
source,
"transparent variant can't contain #[source]",
Expand Down

0 comments on commit dc3c5c6

Please sign in to comment.