diff --git a/Cargo.lock b/Cargo.lock index b3722fdddec2..0eb199156cf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1172,6 +1172,7 @@ dependencies = [ name = "eframe" version = "0.27.2" dependencies = [ + "ahash", "bytemuck", "directories-next", "document-features", @@ -1227,6 +1228,7 @@ dependencies = [ name = "egui-wgpu" version = "0.27.2" dependencies = [ + "ahash", "bytemuck", "document-features", "egui", @@ -1245,6 +1247,7 @@ name = "egui-winit" version = "0.27.2" dependencies = [ "accesskit_winit", + "ahash", "arboard", "document-features", "egui", @@ -1302,6 +1305,7 @@ dependencies = [ name = "egui_extras" version = "0.27.2" dependencies = [ + "ahash", "chrono", "document-features", "egui", @@ -1320,6 +1324,7 @@ dependencies = [ name = "egui_glow" version = "0.27.2" dependencies = [ + "ahash", "bytemuck", "document-features", "egui", @@ -1340,6 +1345,7 @@ dependencies = [ name = "egui_plot" version = "0.27.2" dependencies = [ + "ahash", "document-features", "egui", "serde", diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index f992c5c66a27..4a5a9918a127 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -129,6 +129,7 @@ egui = { workspace = true, default-features = false, features = [ "log", ] } +ahash.workspace = true document-features.workspace = true log.workspace = true parking_lot.workspace = true diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index 0fbb48a09c74..ec7669b077c2 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -26,10 +26,10 @@ use winit::{ window::{Window, WindowId}, }; +use ahash::{HashMap, HashSet}; use egui::{ - ahash::HashSet, epaint::ahash::HashMap, DeferredViewportUiCallback, ImmediateViewport, - ViewportBuilder, ViewportClass, ViewportId, ViewportIdMap, ViewportIdPair, ViewportInfo, - ViewportOutput, + DeferredViewportUiCallback, ImmediateViewport, ViewportBuilder, ViewportClass, ViewportId, + ViewportIdMap, ViewportIdPair, ViewportInfo, ViewportOutput, }; #[cfg(feature = "accesskit")] use egui_winit::accesskit_winit; diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 3ee249edf76e..7087ed6ae713 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -2,7 +2,7 @@ use std::{cell::RefCell, time::Instant}; use winit::event_loop::{EventLoop, EventLoopBuilder}; -use egui::epaint::ahash::HashMap; +use ahash::HashMap; use crate::{ epi, diff --git a/crates/eframe/src/native/wgpu_integration.rs b/crates/eframe/src/native/wgpu_integration.rs index f365d74ad93d..9380bbf72d6c 100644 --- a/crates/eframe/src/native/wgpu_integration.rs +++ b/crates/eframe/src/native/wgpu_integration.rs @@ -15,8 +15,8 @@ use winit::{ window::{Window, WindowId}, }; +use ahash::{HashMap, HashSet, HashSetExt}; use egui::{ - ahash::{HashMap, HashSet, HashSetExt}, DeferredViewportUiCallback, FullOutput, ImmediateViewport, ViewportBuilder, ViewportClass, ViewportId, ViewportIdMap, ViewportIdPair, ViewportIdSet, ViewportInfo, ViewportOutput, }; diff --git a/crates/egui-wgpu/Cargo.toml b/crates/egui-wgpu/Cargo.toml index 1de7d1446ef1..3eaac2e92f5d 100644 --- a/crates/egui-wgpu/Cargo.toml +++ b/crates/egui-wgpu/Cargo.toml @@ -50,6 +50,7 @@ x11 = ["winit?/x11"] egui = { workspace = true, default-features = false } epaint = { workspace = true, default-features = false, features = ["bytemuck"] } +ahash.workspace = true bytemuck.workspace = true document-features.workspace = true log.workspace = true diff --git a/crates/egui-wgpu/src/renderer.rs b/crates/egui-wgpu/src/renderer.rs index 49397c9af892..a4bc8809c35c 100644 --- a/crates/egui-wgpu/src/renderer.rs +++ b/crates/egui-wgpu/src/renderer.rs @@ -2,7 +2,8 @@ use std::{borrow::Cow, num::NonZeroU64, ops::Range}; -use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex}; +use ahash::HashMap; +use epaint::{emath::NumExt, PaintCallbackInfo, Primitive, Vertex}; use wgpu::util::DeviceExt as _; diff --git a/crates/egui-winit/Cargo.toml b/crates/egui-winit/Cargo.toml index 6354b7a439f1..0cf9bf9403ae 100644 --- a/crates/egui-winit/Cargo.toml +++ b/crates/egui-winit/Cargo.toml @@ -59,6 +59,8 @@ x11 = ["winit/x11", "bytemuck"] [dependencies] egui = { workspace = true, default-features = false, features = ["log"] } + +ahash.workspace = true log.workspace = true raw-window-handle.workspace = true web-time.workspace = true diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index 7b40f92b7735..9a57359887b3 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -14,9 +14,7 @@ pub use accesskit_winit; pub use egui; #[cfg(feature = "accesskit")] use egui::accesskit; -use egui::{ - ahash::HashSet, Pos2, Rect, Vec2, ViewportBuilder, ViewportCommand, ViewportId, ViewportInfo, -}; +use egui::{Pos2, Rect, Vec2, ViewportBuilder, ViewportCommand, ViewportId, ViewportInfo}; pub use winit; pub mod clipboard; @@ -24,6 +22,7 @@ mod window_settings; pub use window_settings::WindowSettings; +use ahash::HashSet; use raw_window_handle::HasDisplayHandle; #[allow(unused_imports)] diff --git a/crates/egui/src/id.rs b/crates/egui/src/id.rs index 0465c32d76c8..c5047c266137 100644 --- a/crates/egui/src/id.rs +++ b/crates/egui/src/id.rs @@ -52,13 +52,13 @@ impl Id { /// Generate a new [`Id`] by hashing some source (e.g. a string or integer). pub fn new(source: impl std::hash::Hash) -> Self { - Self::from_hash(epaint::ahash::RandomState::with_seeds(1, 2, 3, 4).hash_one(source)) + Self::from_hash(ahash::RandomState::with_seeds(1, 2, 3, 4).hash_one(source)) } /// Generate a new [`Id`] by hashing the parent [`Id`] and the given argument. pub fn with(self, child: impl std::hash::Hash) -> Self { use std::hash::{BuildHasher, Hasher}; - let mut hasher = epaint::ahash::RandomState::with_seeds(1, 2, 3, 4).build_hasher(); + let mut hasher = ahash::RandomState::with_seeds(1, 2, 3, 4).build_hasher(); hasher.write_u64(self.0.get()); child.hash(&mut hasher); Self::from_hash(hasher.finish()) diff --git a/crates/egui_extras/Cargo.toml b/crates/egui_extras/Cargo.toml index edbac462c944..b5d8efffac7f 100644 --- a/crates/egui_extras/Cargo.toml +++ b/crates/egui_extras/Cargo.toml @@ -64,6 +64,7 @@ syntect = ["dep:syntect"] [dependencies] egui = { workspace = true, default-features = false, features = ["serde"] } +ahash.workspace = true enum-map = { version = "2", features = ["serde"] } log.workspace = true serde.workspace = true diff --git a/crates/egui_extras/src/loaders/ehttp_loader.rs b/crates/egui_extras/src/loaders/ehttp_loader.rs index 9aeb1b663caf..79c776948c33 100644 --- a/crates/egui_extras/src/loaders/ehttp_loader.rs +++ b/crates/egui_extras/src/loaders/ehttp_loader.rs @@ -1,5 +1,5 @@ +use ahash::HashMap; use egui::{ - ahash::HashMap, load::{Bytes, BytesLoadResult, BytesLoader, BytesPoll, LoadError}, mutex::Mutex, }; diff --git a/crates/egui_extras/src/loaders/file_loader.rs b/crates/egui_extras/src/loaders/file_loader.rs index afa7d0eefd6d..b90cff957540 100644 --- a/crates/egui_extras/src/loaders/file_loader.rs +++ b/crates/egui_extras/src/loaders/file_loader.rs @@ -1,5 +1,5 @@ +use ahash::HashMap; use egui::{ - ahash::HashMap, load::{Bytes, BytesLoadResult, BytesLoader, BytesPoll, LoadError}, mutex::Mutex, }; diff --git a/crates/egui_extras/src/loaders/image_loader.rs b/crates/egui_extras/src/loaders/image_loader.rs index 19a91105a63f..14086df935b6 100644 --- a/crates/egui_extras/src/loaders/image_loader.rs +++ b/crates/egui_extras/src/loaders/image_loader.rs @@ -1,5 +1,5 @@ +use ahash::HashMap; use egui::{ - ahash::HashMap, load::{BytesPoll, ImageLoadResult, ImageLoader, ImagePoll, LoadError, SizeHint}, mutex::Mutex, ColorImage, diff --git a/crates/egui_extras/src/loaders/svg_loader.rs b/crates/egui_extras/src/loaders/svg_loader.rs index 1794a8724f4d..67b59540c69f 100644 --- a/crates/egui_extras/src/loaders/svg_loader.rs +++ b/crates/egui_extras/src/loaders/svg_loader.rs @@ -1,7 +1,8 @@ use std::{mem::size_of, path::Path, sync::Arc}; +use ahash::HashMap; + use egui::{ - ahash::HashMap, load::{BytesPoll, ImageLoadResult, ImageLoader, ImagePoll, LoadError, SizeHint}, mutex::Mutex, ColorImage, diff --git a/crates/egui_glow/Cargo.toml b/crates/egui_glow/Cargo.toml index 29129dddc3f2..28de667e8c1a 100644 --- a/crates/egui_glow/Cargo.toml +++ b/crates/egui_glow/Cargo.toml @@ -56,6 +56,7 @@ x11 = ["winit?/x11"] egui = { workspace = true, default-features = false, features = ["bytemuck"] } egui-winit = { workspace = true, optional = true, default-features = false } +ahash.workspace = true bytemuck.workspace = true glow.workspace = true log.workspace = true diff --git a/crates/egui_glow/src/winit.rs b/crates/egui_glow/src/winit.rs index 0c407ccb75de..5f981ab66d90 100644 --- a/crates/egui_glow/src/winit.rs +++ b/crates/egui_glow/src/winit.rs @@ -1,8 +1,8 @@ +use ahash::HashSet; +use egui::{ViewportId, ViewportOutput}; pub use egui_winit; -pub use egui_winit::EventResponse; - -use egui::{ahash::HashSet, ViewportId, ViewportOutput}; use egui_winit::winit; +pub use egui_winit::EventResponse; use crate::shader_version::ShaderVersion; diff --git a/crates/egui_plot/Cargo.toml b/crates/egui_plot/Cargo.toml index bc42765ea162..17e45852242f 100644 --- a/crates/egui_plot/Cargo.toml +++ b/crates/egui_plot/Cargo.toml @@ -37,6 +37,7 @@ serde = ["dep:serde", "egui/serde"] [dependencies] egui = { workspace = true, default-features = false } +ahash.workspace = true #! ### Optional dependencies ## Enable this when generating docs. diff --git a/crates/egui_plot/src/lib.rs b/crates/egui_plot/src/lib.rs index 164710bef265..a46b7a225a53 100644 --- a/crates/egui_plot/src/lib.rs +++ b/crates/egui_plot/src/lib.rs @@ -15,7 +15,7 @@ mod transform; use std::{cmp::Ordering, ops::RangeInclusive, sync::Arc}; -use egui::ahash::HashMap; +use ahash::HashMap; use egui::*; use emath::Float as _; use epaint::Hsva; diff --git a/crates/egui_plot/src/memory.rs b/crates/egui_plot/src/memory.rs index 6a982269f269..5e6718651440 100644 --- a/crates/egui_plot/src/memory.rs +++ b/crates/egui_plot/src/memory.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; -use egui::{ahash, Context, Id, Pos2, Vec2b}; +use egui::{Context, Id, Pos2, Vec2b}; use crate::{PlotBounds, PlotTransform};