Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/extrema_set.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(feature = "use_alloc")]
use alloc::{vec, vec::Vec};
use std::cmp::Ordering;

/// Implementation guts for `min_set`, `min_set_by`, and `min_set_by_key`.
Expand Down
16 changes: 7 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ use std::hash::Hash;
use std::iter::{once, IntoIterator};
#[cfg(feature = "use_alloc")]
type VecIntoIter<T> = alloc::vec::IntoIter<T>;
#[cfg(feature = "use_alloc")]
use std::iter::FromIterator;

#[macro_use]
Expand Down Expand Up @@ -178,7 +177,7 @@ mod diff;
#[cfg(feature = "use_std")]
mod duplicates_impl;
mod exactly_one_err;
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
mod extrema_set;
mod flatten_ok;
mod format;
Expand Down Expand Up @@ -2214,7 +2213,6 @@ pub trait Itertools: Iterator {
/// Ok(())
/// }
/// ```
#[cfg(feature = "use_alloc")]
fn try_collect<T, U, E>(self) -> Result<U, E>
where
Self: Sized + Iterator<Item = Result<T, E>>,
Expand Down Expand Up @@ -3171,7 +3169,7 @@ pub trait Itertools: Iterator {
///
/// The elements can be floats but no particular result is guaranteed
/// if an element is NaN.
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
fn min_set(self) -> Vec<Self::Item>
where
Self: Sized,
Expand Down Expand Up @@ -3204,7 +3202,7 @@ pub trait Itertools: Iterator {
///
/// The elements can be floats but no particular result is guaranteed
/// if an element is NaN.
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
fn min_set_by<F>(self, mut compare: F) -> Vec<Self::Item>
where
Self: Sized,
Expand Down Expand Up @@ -3236,7 +3234,7 @@ pub trait Itertools: Iterator {
///
/// The elements can be floats but no particular result is guaranteed
/// if an element is NaN.
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
where
Self: Sized,
Expand Down Expand Up @@ -3268,7 +3266,7 @@ pub trait Itertools: Iterator {
///
/// The elements can be floats but no particular result is guaranteed
/// if an element is NaN.
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
fn max_set(self) -> Vec<Self::Item>
where
Self: Sized,
Expand Down Expand Up @@ -3301,7 +3299,7 @@ pub trait Itertools: Iterator {
///
/// The elements can be floats but no particular result is guaranteed
/// if an element is NaN.
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
fn max_set_by<F>(self, mut compare: F) -> Vec<Self::Item>
where
Self: Sized,
Expand Down Expand Up @@ -3333,7 +3331,7 @@ pub trait Itertools: Iterator {
///
/// The elements can be floats but no particular result is guaranteed
/// if an element is NaN.
#[cfg(feature = "use_std")]
#[cfg(feature = "use_alloc")]
fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
where
Self: Sized,
Expand Down