Skip to main content

shuffle

Function shuffle 

Source
pub fn shuffle<T, U>(table: U) -> U
where U: AsMut<[T]>,
Available on crate feature rand only.
Expand description

使用系统熵原地打乱可变序列。

§Feature Requirement

需要启用 "rand" 特性。

§Examples

use lib_unknown::rand::shuffle;

let v = shuffle([0, 1, 2, 3, 4, 5, 6, 7]);
assert_eq!(v.len(), 8);