Skip to content

Commit

Permalink
extrema_set only needs alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet authored and jswrenn committed Sep 29, 2023
1 parent 3de6d24 commit 2ec463c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,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 @@ -3169,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 @@ -3202,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 @@ -3234,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 @@ -3266,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 @@ -3299,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 @@ -3331,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

0 comments on commit 2ec463c

Please sign in to comment.