From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/itertools/src/unique_impl.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vendor/itertools/src/unique_impl.rs') diff --git a/vendor/itertools/src/unique_impl.rs b/vendor/itertools/src/unique_impl.rs index 2240f36ed..4e81e78ec 100644 --- a/vendor/itertools/src/unique_impl.rs +++ b/vendor/itertools/src/unique_impl.rs @@ -1,6 +1,5 @@ - use std::collections::HashMap; -use std::collections::hash_map::{Entry}; +use std::collections::hash_map::Entry; use std::hash::Hash; use std::fmt; use std::iter::FusedIterator; @@ -12,7 +11,9 @@ use std::iter::FusedIterator; #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] pub struct UniqueBy { iter: I, - // Use a hashmap for the entry API + // Use a Hashmap for the Entry API in order to prevent hashing twice. + // This can maybe be replaced with a HashSet once `get_or_insert_with` + // or a proper Entry API for Hashset is stable and meets this msrv used: HashMap, f: F, } -- cgit v1.2.3