Skip to content

Commit e66e338

Browse files
aatifsyedphimuemue
authored andcommitted
fix: feature gating
1 parent e994cce commit e66e338

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

src/peeking_take_while.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -244,27 +244,26 @@ peeking_next_by_clone! { ['a, T] ::std::result::Iter<'a, T> }
244244
peeking_next_by_clone! { [T] ::std::iter::Empty<T> }
245245

246246
#[cfg(feature = "use_alloc")]
247-
peeking_next_by_clone! { ['a, T] alloc::collections::linked_list::Iter<'a, T> }
248-
#[cfg(feature = "use_alloc")]
249-
peeking_next_by_clone! { ['a, T] alloc::collections::vec_deque::Iter<'a, T> }
247+
const _: () = {
248+
peeking_next_by_clone! { ['a, T] alloc::collections::linked_list::Iter<'a, T> }
249+
peeking_next_by_clone! { ['a, T] alloc::collections::vec_deque::Iter<'a, T> }
250250

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> }
251+
peeking_next_by_clone! { ['a, K, V] alloc::collections::btree_map::Iter<'a, K, V> }
252+
peeking_next_by_clone! { ['a, K, V] alloc::collections::btree_map::Keys<'a, K, V> }
253+
peeking_next_by_clone! { ['a, K, V] alloc::collections::btree_map::Values<'a, K, V> }
257254

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> }
255+
peeking_next_by_clone! { ['a, T] alloc::collections::btree_set::Iter<'a, T> }
256+
peeking_next_by_clone! { ['a, T] alloc::collections::binary_heap::Iter<'a, T> }
257+
};
262258

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> }
259+
#[cfg(feature = "use_std")]
260+
const _: () = {
261+
peeking_next_by_clone! { ['a, K, V] std::collections::hash_map::Iter<'a, K, V> }
262+
peeking_next_by_clone! { ['a, K, V] std::collections::hash_map::Keys<'a, K, V> }
263+
peeking_next_by_clone! { ['a, K, V] std::collections::hash_map::Values<'a, K, V> }
266264

267-
peeking_next_by_clone! { ['a, T] std::collections::hash_set::Iter<'a, T> }
265+
peeking_next_by_clone! { ['a, T] std::collections::hash_set::Iter<'a, T> }
266+
};
268267

269268
// cloning a Rev has no extra overhead; peekable and put backs are never DEI.
270269
peeking_next_by_clone! { [I: Clone + PeekingNext + DoubleEndedIterator]

0 commit comments

Comments
 (0)