Skip to content

Commit 2ec463c

Browse files
Philippe-Choletjswrenn
authored andcommitted
extrema_set only needs alloc
1 parent 3de6d24 commit 2ec463c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/extrema_set.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(feature = "use_alloc")]
2+
use alloc::{vec, vec::Vec};
13
use std::cmp::Ordering;
24

35
/// Implementation guts for `min_set`, `min_set_by`, and `min_set_by_key`.

src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ mod diff;
177177
#[cfg(feature = "use_std")]
178178
mod duplicates_impl;
179179
mod exactly_one_err;
180-
#[cfg(feature = "use_std")]
180+
#[cfg(feature = "use_alloc")]
181181
mod extrema_set;
182182
mod flatten_ok;
183183
mod format;
@@ -3169,7 +3169,7 @@ pub trait Itertools: Iterator {
31693169
///
31703170
/// The elements can be floats but no particular result is guaranteed
31713171
/// if an element is NaN.
3172-
#[cfg(feature = "use_std")]
3172+
#[cfg(feature = "use_alloc")]
31733173
fn min_set(self) -> Vec<Self::Item>
31743174
where
31753175
Self: Sized,
@@ -3202,7 +3202,7 @@ pub trait Itertools: Iterator {
32023202
///
32033203
/// The elements can be floats but no particular result is guaranteed
32043204
/// if an element is NaN.
3205-
#[cfg(feature = "use_std")]
3205+
#[cfg(feature = "use_alloc")]
32063206
fn min_set_by<F>(self, mut compare: F) -> Vec<Self::Item>
32073207
where
32083208
Self: Sized,
@@ -3234,7 +3234,7 @@ pub trait Itertools: Iterator {
32343234
///
32353235
/// The elements can be floats but no particular result is guaranteed
32363236
/// if an element is NaN.
3237-
#[cfg(feature = "use_std")]
3237+
#[cfg(feature = "use_alloc")]
32383238
fn min_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
32393239
where
32403240
Self: Sized,
@@ -3266,7 +3266,7 @@ pub trait Itertools: Iterator {
32663266
///
32673267
/// The elements can be floats but no particular result is guaranteed
32683268
/// if an element is NaN.
3269-
#[cfg(feature = "use_std")]
3269+
#[cfg(feature = "use_alloc")]
32703270
fn max_set(self) -> Vec<Self::Item>
32713271
where
32723272
Self: Sized,
@@ -3299,7 +3299,7 @@ pub trait Itertools: Iterator {
32993299
///
33003300
/// The elements can be floats but no particular result is guaranteed
33013301
/// if an element is NaN.
3302-
#[cfg(feature = "use_std")]
3302+
#[cfg(feature = "use_alloc")]
33033303
fn max_set_by<F>(self, mut compare: F) -> Vec<Self::Item>
33043304
where
33053305
Self: Sized,
@@ -3331,7 +3331,7 @@ pub trait Itertools: Iterator {
33313331
///
33323332
/// The elements can be floats but no particular result is guaranteed
33333333
/// if an element is NaN.
3334-
#[cfg(feature = "use_std")]
3334+
#[cfg(feature = "use_alloc")]
33353335
fn max_set_by_key<K, F>(self, key: F) -> Vec<Self::Item>
33363336
where
33373337
Self: Sized,

0 commit comments

Comments
 (0)