Skip to content

Commit da8dee1

Browse files
committed
feat: impl PeekingNext for std::collections::*
1 parent 0559142 commit da8dee1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/peeking_take_while.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,30 @@ peeking_next_by_clone! { ['a] ::std::str::Bytes<'a> }
242242
peeking_next_by_clone! { ['a, T] ::std::option::Iter<'a, T> }
243243
peeking_next_by_clone! { ['a, T] ::std::result::Iter<'a, T> }
244244
peeking_next_by_clone! { [T] ::std::iter::Empty<T> }
245+
245246
#[cfg(feature = "use_alloc")]
246247
peeking_next_by_clone! { ['a, T] alloc::collections::linked_list::Iter<'a, T> }
247248
#[cfg(feature = "use_alloc")]
248249
peeking_next_by_clone! { ['a, T] alloc::collections::vec_deque::Iter<'a, T> }
249250

251+
#[cfg(feature = "use_alloc")]
252+
peeking_next_by_clone! { ['a, K, V] alloc::collections::btree_map::Iter<'a, K, V> }
253+
#[cfg(feature = "use_alloc")]
254+
peeking_next_by_clone! { ['a, K, V] alloc::collections::btree_map::Keys<'a, K, V> }
255+
#[cfg(feature = "use_alloc")]
256+
peeking_next_by_clone! { ['a, K, V] alloc::collections::btree_map::Values<'a, K, V> }
257+
258+
#[cfg(feature = "use_alloc")]
259+
peeking_next_by_clone! { ['a, T] alloc::collections::btree_set::Iter<'a, T> }
260+
#[cfg(feature = "use_alloc")]
261+
peeking_next_by_clone! { ['a, T] alloc::collections::binary_heap::Iter<'a, T> }
262+
263+
peeking_next_by_clone! { ['a, K, V] std::collections::hash_map::Iter<'a, K, V> }
264+
peeking_next_by_clone! { ['a, K, V] std::collections::hash_map::Keys<'a, K, V> }
265+
peeking_next_by_clone! { ['a, K, V] std::collections::hash_map::Values<'a, K, V> }
266+
267+
peeking_next_by_clone! { ['a, T] std::collections::hash_set::Iter<'a, T> }
268+
250269
// cloning a Rev has no extra overhead; peekable and put backs are never DEI.
251270
peeking_next_by_clone! { [I: Clone + PeekingNext + DoubleEndedIterator]
252271
::std::iter::Rev<I> }

0 commit comments

Comments
 (0)