Release Notes: - N/A
Unified · Split
| @@ -7530,6 +7530,7 @@ name = "sqlez" · 7529 unmodified lines | ||
| 7530 | 7530 | version = "0.1.0" |
| 7531 | 7531 | dependencies = [ |
| 7532 | 7532 | "anyhow", |
| 7533 | + "collections", | |
| 7533 | 7534 | "futures 0.3.28", |
| 7534 | 7535 | "indoc", |
| 7535 | 7536 | "lazy_static", |
| @@ -8105,6 +8106,7 @@ version = "0.1.0" · 569 unmodified lines | ||
| 8105 | 8106 | dependencies = [ |
| 8106 | 8107 | "alacritty_terminal", |
| 8107 | 8108 | "anyhow", |
| 8109 | + "collections", | |
| 8108 | 8110 | "db", |
| 8109 | 8111 | "dirs 4.0.0", |
| 8110 | 8112 | "futures 0.3.28", |
| @@ -8200,6 +8202,7 @@ name = "theme" · 89 unmodified lines | ||
| 8200 | 8202 | version = "0.1.0" |
| 8201 | 8203 | dependencies = [ |
| 8202 | 8204 | "anyhow", |
| 8205 | + "collections", | |
| 8203 | 8206 | "color", |
| 8204 | 8207 | "derive_more", |
| 8205 | 8208 | "fs", |
| @@ -9343,6 +9346,7 @@ version = "0.1.0" · 1137 unmodified lines | ||
| 9343 | 9346 | dependencies = [ |
| 9344 | 9347 | "anyhow", |
| 9345 | 9348 | "backtrace", |
| 9349 | + "collections", | |
| 9346 | 9350 | "dirs 3.0.2", |
| 9347 | 9351 | "futures 0.3.28", |
| 9348 | 9352 | "git2", |
| @@ -5,13 +5,13 @@ use client::{ · 4 unmodified lines | ||
| 5 | 5 | user::{User, UserStore}, |
| 6 | 6 | Client, Subscription, TypedEnvelope, UserId, |
| 7 | 7 | }; |
| 8 | +use collections::HashSet; | |
| 8 | 9 | use futures::lock::Mutex; |
| 9 | 10 | use gpui::{ |
| 10 | 11 | AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task, WeakModel, |
| 11 | 12 | }; |
| 12 | 13 | use rand::prelude::*; |
| 13 | 14 | use std::{ |
| 14 | − collections::HashSet, | |
| 15 | 15 | ops::{ControlFlow, Range}, |
| 16 | 16 | sync::Arc, |
| 17 | 17 | }; |
| @@ -10,6 +10,7 @@ use async_tungstenite::tungstenite::{ · 9 unmodified lines | ||
| 10 | 10 | error::Error as WebsocketError, |
| 11 | 11 | http::{Request, StatusCode}, |
| 12 | 12 | }; |
| 13 | +use collections::HashMap; | |
| 13 | 14 | use futures::{ |
| 14 | 15 | channel::oneshot, future::LocalBoxFuture, AsyncReadExt, FutureExt, SinkExt, StreamExt, |
| 15 | 16 | TryFutureExt as _, TryStreamExt, |
| @@ -29,7 +30,6 @@ use serde_json; · 13 unmodified lines | ||
| 29 | 30 | use settings::{Settings, SettingsStore}; |
| 30 | 31 | use std::{ |
| 31 | 32 | any::TypeId, |
| 32 | − collections::HashMap, | |
| 33 | 33 | convert::TryFrom, |
| 34 | 34 | fmt::Write as _, |
| 35 | 35 | future::Future, |
| @@ -23,7 +23,7 @@ use crate::{ · 22 unmodified lines | ||
| 23 | 23 | TextSystem, View, ViewContext, Window, WindowContext, WindowHandle, WindowId, |
| 24 | 24 | }; |
| 25 | 25 | use anyhow::{anyhow, Result}; |
| 26 | −use collections::{FxHashMap, FxHashSet, VecDeque}; | |
| 26 | +use collections::{HashMap, HashSet, VecDeque}; | |
| 27 | 27 | use futures::{channel::oneshot, future::LocalBoxFuture, Future}; |
| 28 | 28 | |
| 29 | 29 | use slotmap::SlotMap; |
| @@ -212,24 +212,24 @@ pub struct AppContext { · 182 unmodified lines | ||
| 212 | 212 | pending_updates: usize, |
| 213 | 213 | pub(crate) actions: Rc<ActionRegistry>, |
| 214 | 214 | pub(crate) active_drag: Option<AnyDrag>, |
| 215 | − pub(crate) next_frame_callbacks: FxHashMap<DisplayId, Vec<FrameCallback>>, | |
| 216 | − pub(crate) frame_consumers: FxHashMap<DisplayId, Task<()>>, | |
| 215 | + pub(crate) next_frame_callbacks: HashMap<DisplayId, Vec<FrameCallback>>, | |
| 216 | + pub(crate) frame_consumers: HashMap<DisplayId, Task<()>>, | |
| 217 | 217 | pub(crate) background_executor: BackgroundExecutor, |
| 218 | 218 | pub(crate) foreground_executor: ForegroundExecutor, |
| 219 | 219 | pub(crate) svg_renderer: SvgRenderer, |
| 220 | 220 | asset_source: Arc<dyn AssetSource>, |
| 221 | 221 | pub(crate) image_cache: ImageCache, |
| 222 | 222 | pub(crate) text_style_stack: Vec<TextStyleRefinement>, |
| 223 | − pub(crate) globals_by_type: FxHashMap<TypeId, Box<dyn Any>>, | |
| 223 | + pub(crate) globals_by_type: HashMap<TypeId, Box<dyn Any>>, | |
| 224 | 224 | pub(crate) entities: EntityMap, |
| 225 | 225 | pub(crate) new_view_observers: SubscriberSet<TypeId, NewViewListener>, |
| 226 | 226 | pub(crate) windows: SlotMap<WindowId, Option<Window>>, |
| 227 | 227 | pub(crate) keymap: Rc<RefCell<Keymap>>, |
| 228 | 228 | pub(crate) global_action_listeners: |
| 229 | − FxHashMap<TypeId, Vec<Rc<dyn Fn(&dyn Any, DispatchPhase, &mut Self)>>>, | |
| 229 | + HashMap<TypeId, Vec<Rc<dyn Fn(&dyn Any, DispatchPhase, &mut Self)>>>, | |
| 230 | 230 | pending_effects: VecDeque<Effect>, |
| 231 | − pub(crate) pending_notifications: FxHashSet<EntityId>, | |
| 232 | − pub(crate) pending_global_notifications: FxHashSet<TypeId>, | |
| 231 | + pub(crate) pending_notifications: HashSet<EntityId>, | |
| 232 | + pub(crate) pending_global_notifications: HashSet<TypeId>, | |
| 233 | 233 | pub(crate) observers: SubscriberSet<EntityId, Handler>, |
| 234 | 234 | // TypeId is the type of the event that the listener callback expects |
| 235 | 235 | pub(crate) event_listeners: SubscriberSet<EntityId, (TypeId, Listener)>, |
| @@ -274,23 +274,23 @@ impl AppContext { · 38 unmodified lines | ||
| 274 | 274 | flushing_effects: false, |
| 275 | 275 | pending_updates: 0, |
| 276 | 276 | active_drag: None, |
| 277 | − next_frame_callbacks: FxHashMap::default(), | |
| 278 | − frame_consumers: FxHashMap::default(), | |
| 277 | + next_frame_callbacks: HashMap::default(), | |
| 278 | + frame_consumers: HashMap::default(), | |
| 279 | 279 | background_executor: executor, |
| 280 | 280 | foreground_executor, |
| 281 | 281 | svg_renderer: SvgRenderer::new(asset_source.clone()), |
| 282 | 282 | asset_source, |
| 283 | 283 | image_cache: ImageCache::new(http_client), |
| 284 | 284 | text_style_stack: Vec::new(), |
| 285 | − globals_by_type: FxHashMap::default(), | |
| 285 | + globals_by_type: HashMap::default(), | |
| 286 | 286 | entities, |
| 287 | 287 | new_view_observers: SubscriberSet::new(), |
| 288 | 288 | windows: SlotMap::with_key(), |
| 289 | 289 | keymap: Rc::new(RefCell::new(Keymap::default())), |
| 290 | − global_action_listeners: FxHashMap::default(), | |
| 290 | + global_action_listeners: HashMap::default(), | |
| 291 | 291 | pending_effects: VecDeque::new(), |
| 292 | − pending_notifications: FxHashSet::default(), | |
| 293 | − pending_global_notifications: FxHashSet::default(), | |
| 292 | + pending_notifications: HashSet::default(), | |
| 293 | + pending_global_notifications: HashSet::default(), | |
| 294 | 294 | observers: SubscriberSet::new(), |
| 295 | 295 | event_listeners: SubscriberSet::new(), |
| 296 | 296 | release_listeners: SubscriberSet::new(), |
| @@ -53,7 +53,7 @@ use crate::{ · 52 unmodified lines | ||
| 53 | 53 | Action, ActionRegistry, DispatchPhase, ElementContext, EntityId, FocusId, KeyBinding, |
| 54 | 54 | KeyContext, Keymap, KeymatchResult, Keystroke, KeystrokeMatcher, WindowContext, |
| 55 | 55 | }; |
| 56 | −use collections::FxHashMap; | |
| 56 | +use collections::HashMap; | |
| 57 | 57 | use smallvec::{smallvec, SmallVec}; |
| 58 | 58 | use std::{ |
| 59 | 59 | any::{Any, TypeId}, |
| @@ -69,9 +69,9 @@ pub(crate) struct DispatchTree { · 9 unmodified lines | ||
| 69 | 69 | node_stack: Vec<DispatchNodeId>, |
| 70 | 70 | pub(crate) context_stack: Vec<KeyContext>, |
| 71 | 71 | nodes: Vec<DispatchNode>, |
| 72 | − focusable_node_ids: FxHashMap<FocusId, DispatchNodeId>, | |
| 73 | − view_node_ids: FxHashMap<EntityId, DispatchNodeId>, | |
| 74 | − keystroke_matchers: FxHashMap<SmallVec<[KeyContext; 4]>, KeystrokeMatcher>, | |
| 72 | + focusable_node_ids: HashMap<FocusId, DispatchNodeId>, | |
| 73 | + view_node_ids: HashMap<EntityId, DispatchNodeId>, | |
| 74 | + keystroke_matchers: HashMap<SmallVec<[KeyContext; 4]>, KeystrokeMatcher>, | |
| 75 | 75 | keymap: Rc<RefCell<Keymap>>, |
| 76 | 76 | action_registry: Rc<ActionRegistry>, |
| 77 | 77 | } |
| @@ -100,9 +100,9 @@ impl DispatchTree { · 22 unmodified lines | ||
| 100 | 100 | node_stack: Vec::new(), |
| 101 | 101 | context_stack: Vec::new(), |
| 102 | 102 | nodes: Vec::new(), |
| 103 | − focusable_node_ids: FxHashMap::default(), | |
| 104 | − view_node_ids: FxHashMap::default(), | |
| 105 | − keystroke_matchers: FxHashMap::default(), | |
| 103 | + focusable_node_ids: HashMap::default(), | |
| 104 | + view_node_ids: HashMap::default(), | |
| 105 | + keystroke_matchers: HashMap::default(), | |
| 106 | 106 | keymap, |
| 107 | 107 | action_registry, |
| 108 | 108 | } |
| @@ -7,12 +7,9 @@ pub use context::*; · 6 unmodified lines | ||
| 7 | 7 | pub(crate) use matcher::*; |
| 8 | 8 | |
| 9 | 9 | use crate::{Action, Keystroke, NoAction}; |
| 10 | −use collections::HashSet; | |
| 10 | +use collections::{HashMap, HashSet}; | |
| 11 | 11 | use smallvec::SmallVec; |
| 12 | −use std::{ | |
| 13 | − any::{Any, TypeId}, | |
| 14 | − collections::HashMap, | |
| 15 | −}; | |
| 12 | +use std::any::{Any, TypeId}; | |
| 16 | 13 | |
| 17 | 14 | /// An opaque identifier of which version of the keymap is currently active. |
| 18 | 15 | /// The keymap's version is changed whenever bindings are added or removed. |
| @@ -3,7 +3,7 @@ use crate::{ · 2 unmodified lines | ||
| 3 | 3 | Point, Size, |
| 4 | 4 | }; |
| 5 | 5 | use anyhow::Result; |
| 6 | −use collections::FxHashMap; | |
| 6 | +use collections::HashMap; | |
| 7 | 7 | use derive_more::{Deref, DerefMut}; |
| 8 | 8 | use etagere::BucketedAtlasAllocator; |
| 9 | 9 | use metal::Device; |
| @@ -53,7 +53,7 @@ struct MetalAtlasState { · 43 unmodified lines | ||
| 53 | 53 | monochrome_textures: Vec<MetalAtlasTexture>, |
| 54 | 54 | polychrome_textures: Vec<MetalAtlasTexture>, |
| 55 | 55 | path_textures: Vec<MetalAtlasTexture>, |
| 56 | − tiles_by_key: FxHashMap<AtlasKey, AtlasTile>, | |
| 56 | + tiles_by_key: HashMap<AtlasKey, AtlasTile>, | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | impl PlatformAtlas for MetalAtlas { |
| @@ -2,7 +2,7 @@ use crate::{ · 1 unmodified line | ||
| 2 | 2 | point, AtlasTextureId, AtlasTile, Bounds, ContentMask, Corners, Edges, EntityId, Hsla, Pixels, |
| 3 | 3 | Point, ScaledPixels, StackingOrder, |
| 4 | 4 | }; |
| 5 | −use collections::{BTreeMap, FxHashSet}; | |
| 5 | +use collections::{BTreeMap, HashSet}; | |
| 6 | 6 | use std::{fmt::Debug, iter::Peekable, slice}; |
| 7 | 7 | |
| 8 | 8 | // Exported to metal |
| @@ -159,7 +159,7 @@ impl Scene { · 150 unmodified lines | ||
| 159 | 159 | layer_id |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | − pub fn reuse_views(&mut self, views: &FxHashSet<EntityId>, prev_scene: &mut Self) { | |
| 162 | + pub fn reuse_views(&mut self, views: &HashSet<EntityId>, prev_scene: &mut Self) { | |
| 163 | 163 | for shadow in prev_scene.shadows.drain(..) { |
| 164 | 164 | if views.contains(&shadow.view_id.into()) { |
| 165 | 165 | let order = &prev_scene.orders_by_layer[&shadow.layer_id]; |
| @@ -2,7 +2,7 @@ use crate::{ · 1 unmodified line | ||
| 2 | 2 | AbsoluteLength, Bounds, DefiniteLength, Edges, Length, Pixels, Point, Size, Style, |
| 3 | 3 | WindowContext, |
| 4 | 4 | }; |
| 5 | −use collections::{FxHashMap, FxHashSet}; | |
| 5 | +use collections::{HashMap, HashSet}; | |
| 6 | 6 | use smallvec::SmallVec; |
| 7 | 7 | use std::fmt::Debug; |
| 8 | 8 | use taffy::{ |
| @@ -17,11 +17,11 @@ type NodeMeasureFn = · 8 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | pub struct TaffyLayoutEngine { |
| 19 | 19 | taffy: Taffy, |
| 20 | − styles: FxHashMap<LayoutId, Style>, | |
| 21 | − children_to_parents: FxHashMap<LayoutId, LayoutId>, | |
| 22 | − absolute_layout_bounds: FxHashMap<LayoutId, Bounds<Pixels>>, | |
| 23 | − computed_layouts: FxHashSet<LayoutId>, | |
| 24 | − nodes_to_measure: FxHashMap<LayoutId, NodeMeasureFn>, | |
| 20 | + styles: HashMap<LayoutId, Style>, | |
| 21 | + children_to_parents: HashMap<LayoutId, LayoutId>, | |
| 22 | + absolute_layout_bounds: HashMap<LayoutId, Bounds<Pixels>>, | |
| 23 | + computed_layouts: HashSet<LayoutId>, | |
| 24 | + nodes_to_measure: HashMap<LayoutId, NodeMeasureFn>, | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | static EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by construction if possible"; |
| @@ -30,11 +30,11 @@ impl TaffyLayoutEngine { · 2 unmodified lines | ||
| 30 | 30 | pub fn new() -> Self { |
| 31 | 31 | TaffyLayoutEngine { |
| 32 | 32 | taffy: Taffy::new(), |
| 33 | − styles: FxHashMap::default(), | |
| 34 | − children_to_parents: FxHashMap::default(), | |
| 35 | − absolute_layout_bounds: FxHashMap::default(), | |
| 36 | − computed_layouts: FxHashSet::default(), | |
| 37 | − nodes_to_measure: FxHashMap::default(), | |
| 33 | + styles: HashMap::default(), | |
| 34 | + children_to_parents: HashMap::default(), | |
| 35 | + absolute_layout_bounds: HashMap::default(), | |
| 36 | + computed_layouts: HashSet::default(), | |
| 37 | + nodes_to_measure: HashMap::default(), | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| @@ -13,7 +13,7 @@ use crate::{ · 12 unmodified lines | ||
| 13 | 13 | SharedString, Size, UnderlineStyle, |
| 14 | 14 | }; |
| 15 | 15 | use anyhow::anyhow; |
| 16 | −use collections::{BTreeSet, FxHashMap, FxHashSet}; | |
| 16 | +use collections::{BTreeSet, HashMap, HashSet}; | |
| 17 | 17 | use core::fmt; |
| 18 | 18 | use derive_more::Deref; |
| 19 | 19 | use itertools::Itertools; |
| @@ -42,10 +42,10 @@ pub(crate) const SUBPIXEL_VARIANTS: u8 = 4; · 22 unmodified lines | ||
| 42 | 42 | /// The GPUI text rendering sub system. |
| 43 | 43 | pub struct TextSystem { |
| 44 | 44 | platform_text_system: Arc<dyn PlatformTextSystem>, |
| 45 | − font_ids_by_font: RwLock<FxHashMap<Font, Result<FontId>>>, | |
| 46 | − font_metrics: RwLock<FxHashMap<FontId, FontMetrics>>, | |
| 47 | − raster_bounds: RwLock<FxHashMap<RenderGlyphParams, Bounds<DevicePixels>>>, | |
| 48 | − wrapper_pool: Mutex<FxHashMap<FontIdWithSize, Vec<LineWrapper>>>, | |
| 45 | + font_ids_by_font: RwLock<HashMap<Font, Result<FontId>>>, | |
| 46 | + font_metrics: RwLock<HashMap<FontId, FontMetrics>>, | |
| 47 | + raster_bounds: RwLock<HashMap<RenderGlyphParams, Bounds<DevicePixels>>>, | |
| 48 | + wrapper_pool: Mutex<HashMap<FontIdWithSize, Vec<LineWrapper>>>, | |
| 49 | 49 | font_runs_pool: Mutex<Vec<Vec<FontRun>>>, |
| 50 | 50 | fallback_font_stack: SmallVec<[Font; 2]>, |
| 51 | 51 | } |
| @@ -447,7 +447,7 @@ impl WindowTextSystem { · 395 unmodified lines | ||
| 447 | 447 | Ok(lines) |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | − pub(crate) fn finish_frame(&self, reused_views: &FxHashSet<EntityId>) { | |
| 450 | + pub(crate) fn finish_frame(&self, reused_views: &HashSet<EntityId>) { | |
| 451 | 451 | self.line_layout_cache.finish_frame(reused_views) |
| 452 | 452 | } |
| 453 | 453 | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | use crate::{px, EntityId, FontId, GlyphId, Pixels, PlatformTextSystem, Point, Size}; |
| 2 | −use collections::{FxHashMap, FxHashSet}; | |
| 2 | +use collections::{HashMap, HashSet}; | |
| 3 | 3 | use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard}; |
| 4 | 4 | use smallvec::SmallVec; |
| 5 | 5 | use std::{ |
| @@ -277,10 +277,10 @@ impl WrappedLineLayout { · 271 unmodified lines | ||
| 277 | 277 | |
| 278 | 278 | pub(crate) struct LineLayoutCache { |
| 279 | 279 | view_stack: Mutex<Vec<EntityId>>, |
| 280 | − previous_frame: Mutex<FxHashMap<CacheKey, Arc<LineLayout>>>, | |
| 281 | − current_frame: RwLock<FxHashMap<CacheKey, Arc<LineLayout>>>, | |
| 282 | − previous_frame_wrapped: Mutex<FxHashMap<CacheKey, Arc<WrappedLineLayout>>>, | |
| 283 | − current_frame_wrapped: RwLock<FxHashMap<CacheKey, Arc<WrappedLineLayout>>>, | |
| 280 | + previous_frame: Mutex<HashMap<CacheKey, Arc<LineLayout>>>, | |
| 281 | + current_frame: RwLock<HashMap<CacheKey, Arc<LineLayout>>>, | |
| 282 | + previous_frame_wrapped: Mutex<HashMap<CacheKey, Arc<WrappedLineLayout>>>, | |
| 283 | + current_frame_wrapped: RwLock<HashMap<CacheKey, Arc<WrappedLineLayout>>>, | |
| 284 | 284 | platform_text_system: Arc<dyn PlatformTextSystem>, |
| 285 | 285 | } |
| 286 | 286 | |
| @@ -296,7 +296,7 @@ impl LineLayoutCache { · 9 unmodified lines | ||
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | − pub fn finish_frame(&self, reused_views: &FxHashSet<EntityId>) { | |
| 299 | + pub fn finish_frame(&self, reused_views: &HashSet<EntityId>) { | |
| 300 | 300 | debug_assert_eq!(self.view_stack.lock().len(), 0); |
| 301 | 301 | |
| 302 | 302 | let mut prev_frame = self.previous_frame.lock(); |
| @@ -10,7 +10,7 @@ use crate::{ · 9 unmodified lines | ||
| 10 | 10 | WindowOptions, WindowTextSystem, |
| 11 | 11 | }; |
| 12 | 12 | use anyhow::{anyhow, Context as _, Result}; |
| 13 | −use collections::FxHashSet; | |
| 13 | +use collections::HashSet; | |
| 14 | 14 | use derive_more::{Deref, DerefMut}; |
| 15 | 15 | use futures::{ |
| 16 | 16 | channel::{mpsc, oneshot}, |
| @@ -259,7 +259,7 @@ pub struct Window { · 242 unmodified lines | ||
| 259 | 259 | pub(crate) element_id_stack: GlobalElementId, |
| 260 | 260 | pub(crate) rendered_frame: Frame, |
| 261 | 261 | pub(crate) next_frame: Frame, |
| 262 | − pub(crate) dirty_views: FxHashSet<EntityId>, | |
| 262 | + pub(crate) dirty_views: HashSet<EntityId>, | |
| 263 | 263 | pub(crate) focus_handles: Arc<RwLock<SlotMap<FocusId, AtomicUsize>>>, |
| 264 | 264 | focus_listeners: SubscriberSet<(), AnyWindowFocusListener>, |
| 265 | 265 | focus_lost_listeners: SubscriberSet<(), AnyObserver>, |
| @@ -428,7 +428,7 @@ impl Window { · 162 unmodified lines | ||
| 428 | 428 | element_id_stack: GlobalElementId::default(), |
| 429 | 429 | rendered_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), |
| 430 | 430 | next_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), |
| 431 | − dirty_views: FxHashSet::default(), | |
| 431 | + dirty_views: HashSet::default(), | |
| 432 | 432 | focus_handles: Arc::new(RwLock::new(SlotMap::with_key())), |
| 433 | 433 | focus_listeners: SubscriberSet::new(), |
| 434 | 434 | focus_lost_listeners: SubscriberSet::new(), |
| @@ -21,7 +21,7 @@ use std::{ · 20 unmodified lines | ||
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | 23 | use anyhow::Result; |
| 24 | −use collections::{FxHashMap, FxHashSet}; | |
| 24 | +use collections::{HashMap, HashSet}; | |
| 25 | 25 | use derive_more::{Deref, DerefMut}; |
| 26 | 26 | use media::core_video::CVImageBuffer; |
| 27 | 27 | use smallvec::SmallVec; |
| @@ -53,8 +53,8 @@ pub(crate) struct TooltipRequest { · 25 unmodified lines | ||
| 53 | 53 | pub(crate) struct Frame { |
| 54 | 54 | pub(crate) focus: Option<FocusId>, |
| 55 | 55 | pub(crate) window_active: bool, |
| 56 | − pub(crate) element_states: FxHashMap<GlobalElementId, ElementStateBox>, | |
| 57 | − pub(crate) mouse_listeners: FxHashMap<TypeId, Vec<(StackingOrder, EntityId, AnyMouseListener)>>, | |
| 56 | + pub(crate) element_states: HashMap<GlobalElementId, ElementStateBox>, | |
| 57 | + pub(crate) mouse_listeners: HashMap<TypeId, Vec<(StackingOrder, EntityId, AnyMouseListener)>>, | |
| 58 | 58 | pub(crate) dispatch_tree: DispatchTree, |
| 59 | 59 | pub(crate) scene: Scene, |
| 60 | 60 | pub(crate) depth_map: Vec<(StackingOrder, EntityId, Bounds<Pixels>)>, |
| @@ -65,13 +65,13 @@ pub(crate) struct Frame { · 4 unmodified lines | ||
| 65 | 65 | pub(crate) element_offset_stack: Vec<Point<Pixels>>, |
| 66 | 66 | pub(crate) requested_input_handler: Option<RequestedInputHandler>, |
| 67 | 67 | pub(crate) tooltip_request: Option<TooltipRequest>, |
| 68 | − pub(crate) cursor_styles: FxHashMap<EntityId, CursorStyle>, | |
| 68 | + pub(crate) cursor_styles: HashMap<EntityId, CursorStyle>, | |
| 69 | 69 | pub(crate) requested_cursor_style: Option<CursorStyle>, |
| 70 | 70 | pub(crate) view_stack: Vec<EntityId>, |
| 71 | − pub(crate) reused_views: FxHashSet<EntityId>, | |
| 71 | + pub(crate) reused_views: HashSet<EntityId>, | |
| 72 | 72 | |
| 73 | 73 | #[cfg(any(test, feature = "test-support"))] |
| 74 | − pub(crate) debug_bounds: collections::FxHashMap<String, Bounds<Pixels>>, | |
| 74 | + pub(crate) debug_bounds: collections::HashMap<String, Bounds<Pixels>>, | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | impl Frame { |
| @@ -79,8 +79,8 @@ impl Frame { · 1 unmodified line | ||
| 79 | 79 | Frame { |
| 80 | 80 | focus: None, |
| 81 | 81 | window_active: false, |
| 82 | − element_states: FxHashMap::default(), | |
| 83 | − mouse_listeners: FxHashMap::default(), | |
| 82 | + element_states: HashMap::default(), | |
| 83 | + mouse_listeners: HashMap::default(), | |
| 84 | 84 | dispatch_tree, |
| 85 | 85 | scene: Scene::default(), |
| 86 | 86 | depth_map: Vec::new(), |
| @@ -91,13 +91,13 @@ impl Frame { · 4 unmodified lines | ||
| 91 | 91 | element_offset_stack: Vec::new(), |
| 92 | 92 | requested_input_handler: None, |
| 93 | 93 | tooltip_request: None, |
| 94 | − cursor_styles: FxHashMap::default(), | |
| 94 | + cursor_styles: HashMap::default(), | |
| 95 | 95 | requested_cursor_style: None, |
| 96 | 96 | view_stack: Vec::new(), |
| 97 | − reused_views: FxHashSet::default(), | |
| 97 | + reused_views: HashSet::default(), | |
| 98 | 98 | |
| 99 | 99 | #[cfg(any(test, feature = "test-support"))] |
| 100 | − debug_bounds: FxHashMap::default(), | |
| 100 | + debug_bounds: HashMap::default(), | |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| @@ -8,6 +8,7 @@ use editor::{actions::Cancel, scroll::Autoscroll, Editor}; · 7 unmodified lines | ||
| 8 | 8 | use file_associations::FileAssociations; |
| 9 | 9 | |
| 10 | 10 | use anyhow::{anyhow, Result}; |
| 11 | +use collections::{hash_map, HashMap}; | |
| 11 | 12 | use gpui::{ |
| 12 | 13 | actions, div, overlay, px, uniform_list, Action, AppContext, AssetSource, AsyncWindowContext, |
| 13 | 14 | ClipboardItem, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, InteractiveElement, |
| @@ -22,14 +23,7 @@ use project::{ · 8 unmodified lines | ||
| 22 | 23 | }; |
| 23 | 24 | use project_panel_settings::{ProjectPanelDockPosition, ProjectPanelSettings}; |
| 24 | 25 | use serde::{Deserialize, Serialize}; |
| 25 | −use std::{ | |
| 26 | − cmp::Ordering, | |
| 27 | − collections::{hash_map, HashMap}, | |
| 28 | − ffi::OsStr, | |
| 29 | − ops::Range, | |
| 30 | − path::Path, | |
| 31 | − sync::Arc, | |
| 32 | −}; | |
| 26 | +use std::{cmp::Ordering, ffi::OsStr, ops::Range, path::Path, sync::Arc}; | |
| 33 | 27 | use theme::ThemeSettings; |
| 34 | 28 | use ui::{prelude::*, v_flex, ContextMenu, Icon, KeyBinding, Label, ListItem}; |
| 35 | 29 | use unicase::UniCase; |
| @@ -1699,15 +1693,13 @@ impl ClipboardEntry { · 1663 unmodified lines | ||
| 1699 | 1693 | #[cfg(test)] |
| 1700 | 1694 | mod tests { |
| 1701 | 1695 | use super::*; |
| 1696 | + use collections::HashSet; | |
| 1702 | 1697 | use gpui::{TestAppContext, View, VisualTestContext, WindowHandle}; |
| 1703 | 1698 | use pretty_assertions::assert_eq; |
| 1704 | 1699 | use project::{project_settings::ProjectSettings, FakeFs}; |
| 1705 | 1700 | use serde_json::json; |
| 1706 | 1701 | use settings::SettingsStore; |
| 1707 | − use std::{ | |
| 1708 | − collections::HashSet, | |
| 1709 | − path::{Path, PathBuf}, | |
| 1710 | − }; | |
| 1702 | + use std::path::{Path, PathBuf}; | |
| 1711 | 1703 | use workspace::AppState; |
| 1712 | 1704 | |
| 1713 | 1705 | #[gpui::test] |
| @@ -3509,7 +3501,7 @@ mod tests { · 1795 unmodified lines | ||
| 3509 | 3501 | cx: &mut VisualTestContext, |
| 3510 | 3502 | ) -> Vec<String> { |
| 3511 | 3503 | let mut result = Vec::new(); |
| 3512 | − let mut project_entries = HashSet::new(); | |
| 3504 | + let mut project_entries = HashSet::default(); | |
| 3513 | 3505 | let mut has_editor = false; |
| 3514 | 3506 | |
| 3515 | 3507 | panel.update(cx, |panel, cx| { |
| @@ -25,11 +25,11 @@ use project::{ · 24 unmodified lines | ||
| 25 | 25 | }; |
| 26 | 26 | use semantic_index::{SemanticIndex, SemanticIndexStatus}; |
| 27 | 27 | |
| 28 | +use collections::HashSet; | |
| 28 | 29 | use settings::Settings; |
| 29 | 30 | use smol::stream::StreamExt; |
| 30 | 31 | use std::{ |
| 31 | 32 | any::{Any, TypeId}, |
| 32 | − collections::HashSet, | |
| 33 | 33 | mem, |
| 34 | 34 | ops::{Not, Range}, |
| 35 | 35 | path::PathBuf, |
| @@ -955,7 +955,7 @@ impl ProjectSearchView { · 919 unmodified lines | ||
| 955 | 955 | semantic_state: None, |
| 956 | 956 | semantic_permissioned: None, |
| 957 | 957 | search_options: options, |
| 958 | − panels_with_errors: HashSet::new(), | |
| 958 | + panels_with_errors: HashSet::default(), | |
| 959 | 959 | active_match_index: None, |
| 960 | 960 | query_editor_was_focused: false, |
| 961 | 961 | included_files_editor, |
| @@ -3,6 +3,7 @@ use ai::{ · 2 unmodified lines | ||
| 3 | 3 | models::TruncationDirection, |
| 4 | 4 | }; |
| 5 | 5 | use anyhow::{anyhow, Result}; |
| 6 | +use collections::HashSet; | |
| 6 | 7 | use language::{Grammar, Language}; |
| 7 | 8 | use rusqlite::{ |
| 8 | 9 | types::{FromSql, FromSqlResult, ToSqlOutput, ValueRef}, |
| @@ -12,7 +13,6 @@ use sha1::{Digest, Sha1}; · 3 unmodified lines | ||
| 12 | 13 | use std::{ |
| 13 | 14 | borrow::Cow, |
| 14 | 15 | cmp::{self, Reverse}, |
| 15 | − collections::HashSet, | |
| 16 | 16 | ops::Range, |
| 17 | 17 | path::Path, |
| 18 | 18 | sync::Arc, |
| @@ -267,7 +267,7 @@ impl CodeContextRetriever { · 248 unmodified lines | ||
| 267 | 267 | |
| 268 | 268 | let mut spans = Vec::new(); |
| 269 | 269 | let mut collapsed_ranges_within = Vec::new(); |
| 270 | − let mut parsed_name_ranges = HashSet::new(); | |
| 270 | + let mut parsed_name_ranges = HashSet::default(); | |
| 271 | 271 | for (i, context_match) in matches.iter().enumerate() { |
| 272 | 272 | // Items which are collapsible but not embeddable have no item range |
| 273 | 273 | let item_range = if let Some(item_range) = context_match.item_range.clone() { |
| @@ -7,6 +7,7 @@ license = "GPL-3.0-or-later" · 6 unmodified lines | ||
| 7 | 7 | |
| 8 | 8 | [dependencies] |
| 9 | 9 | anyhow.workspace = true |
| 10 | +collections.workspace = true | |
| 10 | 11 | futures.workspace = true |
| 11 | 12 | indoc.workspace = true |
| 12 | 13 | lazy_static.workspace = true |
| @@ -1,8 +1,9 @@ | ||
| 1 | 1 | use anyhow::Context; |
| 2 | +use collections::HashMap; | |
| 2 | 3 | use futures::{channel::oneshot, Future, FutureExt}; |
| 3 | 4 | use lazy_static::lazy_static; |
| 4 | 5 | use parking_lot::{Mutex, RwLock}; |
| 5 | −use std::{collections::HashMap, marker::PhantomData, ops::Deref, sync::Arc, thread}; | |
| 6 | +use std::{marker::PhantomData, ops::Deref, sync::Arc, thread}; | |
| 6 | 7 | use thread_local::ThreadLocal; |
| 7 | 8 | |
| 8 | 9 | use crate::{connection::Connection, domain::Migrator, util::UnboundedSyncSender}; |
| @@ -13,6 +13,7 @@ doctest = false · 12 unmodified lines | ||
| 13 | 13 | [dependencies] |
| 14 | 14 | alacritty_terminal = "0.22.0" |
| 15 | 15 | anyhow.workspace = true |
| 16 | +collections.workspace = true | |
| 16 | 17 | db.workspace = true |
| 17 | 18 | dirs = "4.0.0" |
| 18 | 19 | futures.workspace = true |
| @@ -30,6 +30,7 @@ use mappings::mouse::{ · 29 unmodified lines | ||
| 30 | 30 | scroll_report, |
| 31 | 31 | }; |
| 32 | 32 | |
| 33 | +use collections::{HashMap, VecDeque}; | |
| 33 | 34 | use procinfo::LocalProcessInfo; |
| 34 | 35 | use serde::{Deserialize, Serialize}; |
| 35 | 36 | use settings::Settings; |
| @@ -39,7 +40,6 @@ use util::truncate_and_trailoff; · 3 unmodified lines | ||
| 39 | 40 | |
| 40 | 41 | use std::{ |
| 41 | 42 | cmp::{self, min}, |
| 42 | − collections::{HashMap, VecDeque}, | |
| 43 | 43 | fmt::Display, |
| 44 | 44 | ops::{Deref, Index, RangeInclusive}, |
| 45 | 45 | os::unix::prelude::AsRawFd, |
| @@ -1,3 +1,4 @@ | ||
| 1 | +use collections::HashMap; | |
| 1 | 2 | use gpui::{px, AbsoluteLength, AppContext, FontFeatures, Pixels}; |
| 2 | 3 | use schemars::{ |
| 3 | 4 | gen::SchemaGenerator, |
| @@ -7,7 +8,7 @@ use schemars::{ · 3 unmodified lines | ||
| 7 | 8 | use serde_derive::{Deserialize, Serialize}; |
| 8 | 9 | use serde_json::Value; |
| 9 | 10 | use settings::SettingsJsonSchemaParams; |
| 10 | −use std::{collections::HashMap, path::PathBuf}; | |
| 11 | +use std::path::PathBuf; | |
| 11 | 12 | |
| 12 | 13 | #[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] |
| 13 | 14 | #[serde(rename_all = "snake_case")] |
| @@ -8,11 +8,7 @@ license = "GPL-3.0-or-later" · 7 unmodified lines | ||
| 8 | 8 | [features] |
| 9 | 9 | default = [] |
| 10 | 10 | stories = ["dep:itertools", "dep:story"] |
| 11 | −test-support = [ | |
| 12 | − "gpui/test-support", | |
| 13 | − "fs/test-support", | |
| 14 | − "settings/test-support" | |
| 15 | −] | |
| 11 | +test-support = ["gpui/test-support", "fs/test-support", "settings/test-support"] | |
| 16 | 12 | |
| 17 | 13 | [lib] |
| 18 | 14 | path = "src/theme.rs" |
| @@ -20,6 +16,7 @@ doctest = false · 1 unmodified line | ||
| 20 | 16 | |
| 21 | 17 | [dependencies] |
| 22 | 18 | anyhow.workspace = true |
| 19 | +collections.workspace = true | |
| 23 | 20 | color.workspace = true |
| 24 | 21 | derive_more.workspace = true |
| 25 | 22 | fs.workspace = true |
| @@ -1,8 +1,8 @@ | ||
| 1 | −use std::collections::HashMap; | |
| 2 | 1 | use std::path::Path; |
| 3 | 2 | use std::sync::Arc; |
| 4 | 3 | |
| 5 | 4 | use anyhow::{anyhow, Context, Result}; |
| 5 | +use collections::HashMap; | |
| 6 | 6 | use derive_more::{Deref, DerefMut}; |
| 7 | 7 | use fs::Fs; |
| 8 | 8 | use futures::StreamExt; |
| @@ -64,7 +64,7 @@ impl ThemeRegistry { · 55 unmodified lines | ||
| 64 | 64 | pub fn new(assets: Box<dyn AssetSource>) -> Self { |
| 65 | 65 | let registry = Self { |
| 66 | 66 | state: RwLock::new(ThemeRegistryState { |
| 67 | − themes: HashMap::new(), | |
| 67 | + themes: HashMap::default(), | |
| 68 | 68 | }), |
| 69 | 69 | assets, |
| 70 | 70 | }; |
| @@ -15,6 +15,7 @@ test-support = ["tempfile", "git2"] · 14 unmodified lines | ||
| 15 | 15 | [dependencies] |
| 16 | 16 | anyhow.workspace = true |
| 17 | 17 | backtrace = "0.3" |
| 18 | +collections.workspace = true | |
| 18 | 19 | dirs = "3.0" |
| 19 | 20 | futures.workspace = true |
| 20 | 21 | git2 = { workspace = true, optional = true } |
| @@ -1,4 +1,5 @@ | ||
| 1 | −use std::{cmp::Ordering, collections::HashMap, ops::Range}; | |
| 1 | +use collections::HashMap; | |
| 2 | +use std::{cmp::Ordering, ops::Range}; | |
| 2 | 3 | |
| 3 | 4 | /// Construct a string and a list of offsets within that string using a single |
| 4 | 5 | /// string containing embedded position markers. |
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | use anyhow::{anyhow, Context, Result}; |
| 2 | 2 | use cli::{ipc, IpcHandshake}; |
| 3 | 3 | use cli::{ipc::IpcSender, CliRequest, CliResponse}; |
| 4 | +use collections::HashMap; | |
| 4 | 5 | use editor::scroll::Autoscroll; |
| 5 | 6 | use editor::Editor; |
| 6 | 7 | use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender}; |
| @@ -10,7 +11,6 @@ use gpui::{AppContext, AsyncAppContext, Global}; · 3 unmodified lines | ||
| 10 | 11 | use itertools::Itertools; |
| 11 | 12 | use language::{Bias, Point}; |
| 12 | 13 | use release_channel::parse_zed_link; |
| 13 | −use std::collections::HashMap; | |
| 14 | 14 | use std::ffi::OsStr; |
| 15 | 15 | use std::os::unix::prelude::OsStrExt; |
| 16 | 16 | use std::path::Path; |
| @@ -176,7 +176,7 @@ pub async fn handle_cli_connection( · 159 unmodified lines | ||
| 176 | 176 | if let Some(request) = requests.next().await { |
| 177 | 177 | match request { |
| 178 | 178 | CliRequest::Open { paths, wait } => { |
| 179 | − let mut caret_positions = HashMap::new(); | |
| 179 | + let mut caret_positions = HashMap::default(); | |
| 180 | 180 | |
| 181 | 181 | let paths = if paths.is_empty() { |
| 182 | 182 | workspace::last_opened_workspace_paths() |
| @@ -733,6 +733,7 @@ fn open_settings_file( · 732 unmodified lines | ||
| 733 | 733 | mod tests { |
| 734 | 734 | use super::*; |
| 735 | 735 | use assets::Assets; |
| 736 | + use collections::HashSet; | |
| 736 | 737 | use editor::{scroll::Autoscroll, DisplayPoint, Editor}; |
| 737 | 738 | use gpui::{ |
| 738 | 739 | actions, Action, AnyWindowHandle, AppContext, AssetSource, Entity, TestAppContext, |
| @@ -742,10 +743,7 @@ mod tests { · 3 unmodified lines | ||
| 742 | 743 | use project::{project_settings::ProjectSettings, Project, ProjectPath}; |
| 743 | 744 | use serde_json::json; |
| 744 | 745 | use settings::{handle_settings_file_changes, watch_config_file, SettingsStore}; |
| 745 | − use std::{ | |
| 746 | − collections::HashSet, | |
| 747 | − path::{Path, PathBuf}, | |
| 748 | − }; | |
| 746 | + use std::path::{Path, PathBuf}; | |
| 749 | 747 | use theme::{ThemeRegistry, ThemeSettings}; |
| 750 | 748 | use workspace::{ |
| 751 | 749 | item::{Item, ItemHandle}, |