Skip to content

Commit 29e78c7

Browse files
committed
Get rid of "partition_add_index" feature
It offers nothing over the "nightly" feature and makes testing more complicated.
1 parent 437f789 commit 29e78c7

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ appveyor = { repository = "rust-random/rand" }
2323
[features]
2424
# Meta-features:
2525
default = ["std", "std_rng"]
26-
nightly = ["simd_support", "partition_at_index"] # enables all features requiring nightly rust
26+
nightly = ["simd_support"] # enables all features requiring nightly rust
2727
serde1 = ["serde"]
2828

2929
# Option (enabled by default): without "std" rand uses libcore; this option
@@ -45,9 +45,6 @@ std_rng = ["rand_chacha", "rand_hc"]
4545
# Option: enable SmallRng
4646
small_rng = ["rand_pcg"]
4747

48-
# Option (requires nightly): better performance of choose_multiple_weighted
49-
partition_at_index = []
50-
5148
[workspace]
5249
members = [
5350
"rand_core",

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
5151
#![cfg_attr(not(feature = "std"), no_std)]
5252
#![cfg_attr(all(feature = "simd_support", feature = "nightly"), feature(stdsimd))]
53-
#![cfg_attr(all(feature = "partition_at_index", feature = "nightly"), feature(slice_partition_at_index))]
53+
#![cfg_attr(feature = "nightly", feature(slice_partition_at_index))]
5454
#![cfg_attr(doc_cfg, feature(doc_cfg))]
5555
#![allow(
5656
clippy::excessive_precision,

src/seq/index.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ where R: Rng + ?Sized {
268268
/// an alternative.
269269
///
270270
/// This implementation uses `O(length + amount)` space and `O(length)` time
271-
/// if the "partition_at_index" feature is enabled, or `O(length)` space and
271+
/// if the "nightly" feature is enabled, or `O(length)` space and
272272
/// `O(length + amount * log length)` time otherwise.
273273
///
274274
/// Panics if `amount > length`.
@@ -298,7 +298,7 @@ where
298298
/// This implementation uses the algorithm described by Efraimidis and Spirakis
299299
/// in this paper: https://doi.org/10.1016/j.ipl.2005.11.003
300300
/// It uses `O(length + amount)` space and `O(length)` time if the
301-
/// "partition_at_index" feature is enabled, or `O(length)` space and `O(length
301+
/// "nightly" feature is enabled, or `O(length)` space and `O(length
302302
/// + amount * log length)` time otherwise.
303303
///
304304
/// Panics if `amount > length`.
@@ -342,7 +342,7 @@ where
342342
}
343343
impl<N> Eq for Element<N> {}
344344

345-
#[cfg(feature = "partition_at_index")]
345+
#[cfg(feature = "nightly")]
346346
{
347347
let mut candidates = Vec::with_capacity(length.as_usize());
348348
for index in 0..length.as_usize() {
@@ -370,7 +370,7 @@ where
370370
Ok(IndexVec::from(result))
371371
}
372372

373-
#[cfg(not(feature = "partition_at_index"))]
373+
#[cfg(not(feature = "nightly"))]
374374
{
375375
#[cfg(all(feature = "alloc", not(feature = "std")))]
376376
use crate::alloc::collections::BinaryHeap;

0 commit comments

Comments
 (0)