Skip to content

Commit

Permalink
update the other instance of the .tuple_windows() trick to use .dupli…
Browse files Browse the repository at this point in the history
…cates()
  • Loading branch information
mumbleskates committed May 24, 2024
1 parent c4dd462 commit 9eb2e31
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions prost-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ fn try_message(input: TokenStream) -> Result<TokenStream, Error> {
fields.sort_by_key(|(_, field)| field.tags().into_iter().min().unwrap());
let fields = fields;

if let Some((duplicate_tag, _)) = fields
if let Some(duplicate_tag) = fields
.iter()
.flat_map(|(_, field)| field.tags())
.sorted_unstable()
.tuple_windows()
.find(|(a, b)| a == b)
.duplicates()
.next()
{
bail!(
"message {} has multiple fields with tag {}",
Expand Down

0 comments on commit 9eb2e31

Please sign in to comment.