mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-07 23:27:51 +00:00
Update oauth::choose to use new fastrand::choose_multiple
This commit is contained in:
parent
09df7713b1
commit
e452b8d6b5
1 changed files with 1 additions and 1 deletions
|
@ -212,7 +212,7 @@ impl Device {
|
||||||
// Waiting on fastrand 2.0.0 for the `choose` function
|
// Waiting on fastrand 2.0.0 for the `choose` function
|
||||||
// https://github.com/smol-rs/fastrand/pull/59/
|
// https://github.com/smol-rs/fastrand/pull/59/
|
||||||
fn choose<T: Copy>(list: &[T]) -> T {
|
fn choose<T: Copy>(list: &[T]) -> T {
|
||||||
list[fastrand::usize(..list.len())]
|
*fastrand::choose_multiple(list.into_iter(), 1)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue