summaryrefslogtreecommitdiffstats
path: root/futures/src/subscription/tracker.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-01 11:59:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-01 12:00:15 +0200
commitf5bcfec8211c04c4b05f63d01d52d3e5d2cc123e (patch)
tree4a9f0699548cea15b43743dcf00d5628890610ab /futures/src/subscription/tracker.rs
parent14ed71e09b648693dfca9eb29f14147c5c03a6bc (diff)
downloadiced-f5bcfec8211c04c4b05f63d01d52d3e5d2cc123e.tar.gz
iced-f5bcfec8211c04c4b05f63d01d52d3e5d2cc123e.tar.bz2
iced-f5bcfec8211c04c4b05f63d01d52d3e5d2cc123e.zip
Use `rustc-hash` for most of our `HashMap` and `HashSet` instances
Diffstat (limited to '')
-rw-r--r--futures/src/subscription/tracker.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs
index 15ed5b87..277a446b 100644
--- a/futures/src/subscription/tracker.rs
+++ b/futures/src/subscription/tracker.rs
@@ -1,12 +1,11 @@
use crate::core::event::{self, Event};
-use crate::core::Hasher;
-use crate::subscription::Recipe;
+use crate::subscription::{Hasher, Recipe};
use crate::{BoxFuture, MaybeSend};
use futures::channel::mpsc;
use futures::sink::{Sink, SinkExt};
+use rustc_hash::FxHashMap;
-use std::collections::HashMap;
use std::hash::Hasher as _;
/// A registry of subscription streams.
@@ -18,7 +17,7 @@ use std::hash::Hasher as _;
/// [`Subscription`]: crate::Subscription
#[derive(Debug, Default)]
pub struct Tracker {
- subscriptions: HashMap<u64, Execution>,
+ subscriptions: FxHashMap<u64, Execution>,
}
#[derive(Debug)]
@@ -31,7 +30,7 @@ impl Tracker {
/// Creates a new empty [`Tracker`].
pub fn new() -> Self {
Self {
- subscriptions: HashMap::new(),
+ subscriptions: FxHashMap::default(),
}
}