perf: replace rand with fastrand
This commit is contained in:
parent
98d6d33c87
commit
d2e080427f
5 changed files with 7 additions and 12 deletions
|
|
@ -12,7 +12,7 @@ futures.workspace = true
|
|||
i18n-embed-fl.workspace = true
|
||||
i18n-embed.workspace = true
|
||||
libcosmic.workspace = true
|
||||
rand = "0.9"
|
||||
fastrand = "2.3.0"
|
||||
rust-embed.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing-log.workspace = true
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ use cosmic::{
|
|||
};
|
||||
|
||||
use futures::{FutureExt, stream::FuturesUnordered};
|
||||
use rand::Rng;
|
||||
use tokio::{
|
||||
spawn,
|
||||
sync::{
|
||||
|
|
@ -397,8 +396,7 @@ impl BluerSessionState {
|
|||
),
|
||||
))
|
||||
.await;
|
||||
let mut rng = rand::rng();
|
||||
let pin_code = rng.random_range(0..999999);
|
||||
let pin_code = fastrand::u32(0..999999);
|
||||
Ok(format!("{:06}", pin_code))
|
||||
})
|
||||
})),
|
||||
|
|
@ -437,8 +435,7 @@ impl BluerSessionState {
|
|||
),
|
||||
))
|
||||
.await;
|
||||
let mut rng = rand::rng();
|
||||
let pin_code = rng.random_range(0..999999);
|
||||
let pin_code = fastrand::u32(0..999999);
|
||||
Ok(pin_code)
|
||||
})
|
||||
})),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue