Use rustc-hash for most of our HashMap and HashSet instances
This commit is contained in:
parent
14ed71e09b
commit
f5bcfec821
19 changed files with 60 additions and 49 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue