From 2ec463c7c6aa8abe159850f89712cc9e650b34a7 Mon Sep 17 00:00:00 2001 From: Philippe Cholet <44676486+Philippe-Cholet@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:16:51 +0200 Subject: [PATCH] `extrema_set` only needs `alloc` --- src/extrema_set.rs | 2 ++ src/lib.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/extrema_set.rs b/src/extrema_set.rs index ae128364c..d24114c6d 100644 --- a/src/extrema_set.rs +++ b/src/extrema_set.rs @@ -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`. diff --git a/src/lib.rs b/src/lib.rs index 77bc2aad2..3d5f05c4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; @@ -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 where Self: Sized, @@ -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(self, mut compare: F) -> Vec where Self: Sized, @@ -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(self, key: F) -> Vec where Self: Sized, @@ -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 where Self: Sized, @@ -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(self, mut compare: F) -> Vec where Self: Sized, @@ -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(self, key: F) -> Vec where Self: Sized,