perf: replace rand with fastrand

This commit is contained in:
Cheong Lau 2025-10-03 23:25:51 +10:00 committed by GitHub
parent 98d6d33c87
commit d2e080427f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 12 deletions

View file

@ -54,7 +54,6 @@ use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::Sta
use futures::future::pending;
use iced::{Alignment, Background, Length};
use itertools::Itertools;
use rand::{Rng, rng};
use std::{borrow::Cow, collections::HashMap, path::PathBuf, rc::Rc, str::FromStr, time::Duration};
use switcheroo_control::Gpu;
use tokio::time::sleep;
@ -1084,8 +1083,7 @@ impl cosmic::Application for CosmicAppList {
}
self.active_list.clear();
let subscription_ctr = self.subscription_ctr;
let mut rng = rng();
let rand_d = rng.random_range(0..100);
let rand_d = fastrand::u64(0..100);
return iced::Task::perform(
async move {
if let Some(millis) = 2u64