summaryrefslogtreecommitdiffstats
path: root/core
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 /core
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 'core')
-rw-r--r--core/src/image.rs5
-rw-r--r--core/src/lib.rs2
-rw-r--r--core/src/svg.rs5
3 files changed, 6 insertions, 6 deletions
diff --git a/core/src/image.rs b/core/src/image.rs
index 32b95f03..dc74e5c1 100644
--- a/core/src/image.rs
+++ b/core/src/image.rs
@@ -1,6 +1,7 @@
//! Load and draw raster graphics.
-use crate::{Hasher, Rectangle, Size};
+use crate::{Rectangle, Size};
+use rustc_hash::FxHasher;
use std::hash::{Hash, Hasher as _};
use std::path::PathBuf;
use std::sync::Arc;
@@ -50,7 +51,7 @@ impl Handle {
}
fn from_data(data: Data) -> Handle {
- let mut hasher = Hasher::default();
+ let mut hasher = FxHasher::default();
data.hash(&mut hasher);
Handle {
diff --git a/core/src/lib.rs b/core/src/lib.rs
index d076413e..832b2d2d 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -41,7 +41,6 @@ mod background;
mod color;
mod content_fit;
mod element;
-mod hasher;
mod length;
mod padding;
mod pixels;
@@ -64,7 +63,6 @@ pub use element::Element;
pub use event::Event;
pub use font::Font;
pub use gradient::Gradient;
-pub use hasher::Hasher;
pub use layout::Layout;
pub use length::Length;
pub use overlay::Overlay;
diff --git a/core/src/svg.rs b/core/src/svg.rs
index ab207cca..0106e0c2 100644
--- a/core/src/svg.rs
+++ b/core/src/svg.rs
@@ -1,6 +1,7 @@
//! Load and draw vector graphics.
-use crate::{Color, Hasher, Rectangle, Size};
+use crate::{Color, Rectangle, Size};
+use rustc_hash::FxHasher;
use std::borrow::Cow;
use std::hash::{Hash, Hasher as _};
use std::path::PathBuf;
@@ -30,7 +31,7 @@ impl Handle {
}
fn from_data(data: Data) -> Handle {
- let mut hasher = Hasher::default();
+ let mut hasher = FxHasher::default();
data.hash(&mut hasher);
Handle {