Skip to content

Commit dc3c5c6

Browse files
committed
Resolve clippy filter_map_next pedantic lint
1 parent 25f0be5 commit dc3c5c6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

impl/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![allow(
22
clippy::blocks_in_if_conditions,
33
clippy::cast_possible_truncation,
4-
clippy::filter_map_next,
54
clippy::map_unwrap_or,
65
clippy::needless_pass_by_value,
76
clippy::option_if_let_else,

impl/src/valid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Struct<'_> {
2323
"#[error(transparent)] requires exactly one field",
2424
));
2525
}
26-
if let Some(source) = self.fields.iter().filter_map(|f| f.attrs.source).next() {
26+
if let Some(source) = self.fields.iter().find_map(|f| f.attrs.source) {
2727
return Err(Error::new_spanned(
2828
source,
2929
"transparent error struct can't contain #[source]",
@@ -78,7 +78,7 @@ impl Variant<'_> {
7878
"#[error(transparent)] requires exactly one field",
7979
));
8080
}
81-
if let Some(source) = self.fields.iter().filter_map(|f| f.attrs.source).next() {
81+
if let Some(source) = self.fields.iter().find_map(|f| f.attrs.source) {
8282
return Err(Error::new_spanned(
8383
source,
8484
"transparent variant can't contain #[source]",

0 commit comments

Comments
 (0)