diff --git a/Cargo.lock b/Cargo.lock index 8e72a590de..78a47cc604 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7530,7 +7530,6 @@ name = "sqlez" version = "0.1.0" dependencies = [ "anyhow", - "collections", "futures 0.3.28", "indoc", "lazy_static", @@ -8106,7 +8105,6 @@ version = "0.1.0" dependencies = [ "alacritty_terminal", "anyhow", - "collections", "db", "dirs 4.0.0", "futures 0.3.28", @@ -8202,7 +8200,6 @@ name = "theme" version = "0.1.0" dependencies = [ "anyhow", - "collections", "color", "derive_more", "fs", @@ -9346,7 +9343,6 @@ version = "0.1.0" dependencies = [ "anyhow", "backtrace", - "collections", "dirs 3.0.2", "futures 0.3.28", "git2", diff --git a/crates/channel/src/channel_chat.rs b/crates/channel/src/channel_chat.rs index e6ed013ade..ad843470be 100644 --- a/crates/channel/src/channel_chat.rs +++ b/crates/channel/src/channel_chat.rs @@ -5,13 +5,13 @@ use client::{ user::{User, UserStore}, Client, Subscription, TypedEnvelope, UserId, }; -use collections::HashSet; use futures::lock::Mutex; use gpui::{ AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task, WeakModel, }; use rand::prelude::*; use std::{ + collections::HashSet, ops::{ControlFlow, Range}, sync::Arc, }; diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index e454d3ddaf..ff8adc9660 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -10,7 +10,6 @@ use async_tungstenite::tungstenite::{ error::Error as WebsocketError, http::{Request, StatusCode}, }; -use collections::HashMap; use futures::{ channel::oneshot, future::LocalBoxFuture, AsyncReadExt, FutureExt, SinkExt, StreamExt, TryFutureExt as _, TryStreamExt, @@ -30,6 +29,7 @@ use serde_json; use settings::{Settings, SettingsStore}; use std::{ any::TypeId, + collections::HashMap, convert::TryFrom, fmt::Write as _, future::Future, diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index ec4bf83d54..45c26b0ba8 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -23,7 +23,7 @@ use crate::{ TextSystem, View, ViewContext, Window, WindowContext, WindowHandle, WindowId, }; use anyhow::{anyhow, Result}; -use collections::{HashMap, HashSet, VecDeque}; +use collections::{FxHashMap, FxHashSet, VecDeque}; use futures::{channel::oneshot, future::LocalBoxFuture, Future}; use slotmap::SlotMap; @@ -212,24 +212,24 @@ pub struct AppContext { pending_updates: usize, pub(crate) actions: Rc, pub(crate) active_drag: Option, - pub(crate) next_frame_callbacks: HashMap>, - pub(crate) frame_consumers: HashMap>, + pub(crate) next_frame_callbacks: FxHashMap>, + pub(crate) frame_consumers: FxHashMap>, pub(crate) background_executor: BackgroundExecutor, pub(crate) foreground_executor: ForegroundExecutor, pub(crate) svg_renderer: SvgRenderer, asset_source: Arc, pub(crate) image_cache: ImageCache, pub(crate) text_style_stack: Vec, - pub(crate) globals_by_type: HashMap>, + pub(crate) globals_by_type: FxHashMap>, pub(crate) entities: EntityMap, pub(crate) new_view_observers: SubscriberSet, pub(crate) windows: SlotMap>, pub(crate) keymap: Rc>, pub(crate) global_action_listeners: - HashMap>>, + FxHashMap>>, pending_effects: VecDeque, - pub(crate) pending_notifications: HashSet, - pub(crate) pending_global_notifications: HashSet, + pub(crate) pending_notifications: FxHashSet, + pub(crate) pending_global_notifications: FxHashSet, pub(crate) observers: SubscriberSet, // TypeId is the type of the event that the listener callback expects pub(crate) event_listeners: SubscriberSet, @@ -274,23 +274,23 @@ impl AppContext { flushing_effects: false, pending_updates: 0, active_drag: None, - next_frame_callbacks: HashMap::default(), - frame_consumers: HashMap::default(), + next_frame_callbacks: FxHashMap::default(), + frame_consumers: FxHashMap::default(), background_executor: executor, foreground_executor, svg_renderer: SvgRenderer::new(asset_source.clone()), asset_source, image_cache: ImageCache::new(http_client), text_style_stack: Vec::new(), - globals_by_type: HashMap::default(), + globals_by_type: FxHashMap::default(), entities, new_view_observers: SubscriberSet::new(), windows: SlotMap::with_key(), keymap: Rc::new(RefCell::new(Keymap::default())), - global_action_listeners: HashMap::default(), + global_action_listeners: FxHashMap::default(), pending_effects: VecDeque::new(), - pending_notifications: HashSet::default(), - pending_global_notifications: HashSet::default(), + pending_notifications: FxHashSet::default(), + pending_global_notifications: FxHashSet::default(), observers: SubscriberSet::new(), event_listeners: SubscriberSet::new(), release_listeners: SubscriberSet::new(), diff --git a/crates/gpui/src/key_dispatch.rs b/crates/gpui/src/key_dispatch.rs index 894f3b7d84..8f9eb16a62 100644 --- a/crates/gpui/src/key_dispatch.rs +++ b/crates/gpui/src/key_dispatch.rs @@ -53,7 +53,7 @@ use crate::{ Action, ActionRegistry, DispatchPhase, ElementContext, EntityId, FocusId, KeyBinding, KeyContext, Keymap, KeymatchResult, Keystroke, KeystrokeMatcher, WindowContext, }; -use collections::HashMap; +use collections::FxHashMap; use smallvec::{smallvec, SmallVec}; use std::{ any::{Any, TypeId}, @@ -69,9 +69,9 @@ pub(crate) struct DispatchTree { node_stack: Vec, pub(crate) context_stack: Vec, nodes: Vec, - focusable_node_ids: HashMap, - view_node_ids: HashMap, - keystroke_matchers: HashMap, KeystrokeMatcher>, + focusable_node_ids: FxHashMap, + view_node_ids: FxHashMap, + keystroke_matchers: FxHashMap, KeystrokeMatcher>, keymap: Rc>, action_registry: Rc, } @@ -100,9 +100,9 @@ impl DispatchTree { node_stack: Vec::new(), context_stack: Vec::new(), nodes: Vec::new(), - focusable_node_ids: HashMap::default(), - view_node_ids: HashMap::default(), - keystroke_matchers: HashMap::default(), + focusable_node_ids: FxHashMap::default(), + view_node_ids: FxHashMap::default(), + keystroke_matchers: FxHashMap::default(), keymap, action_registry, } diff --git a/crates/gpui/src/keymap.rs b/crates/gpui/src/keymap.rs index e2a6bdfc4b..45e0ebbe95 100644 --- a/crates/gpui/src/keymap.rs +++ b/crates/gpui/src/keymap.rs @@ -7,9 +7,12 @@ pub use context::*; pub(crate) use matcher::*; use crate::{Action, Keystroke, NoAction}; -use collections::{HashMap, HashSet}; +use collections::HashSet; use smallvec::SmallVec; -use std::any::{Any, TypeId}; +use std::{ + any::{Any, TypeId}, + collections::HashMap, +}; /// An opaque identifier of which version of the keymap is currently active. /// The keymap's version is changed whenever bindings are added or removed. diff --git a/crates/gpui/src/platform/mac/metal_atlas.rs b/crates/gpui/src/platform/mac/metal_atlas.rs index c029ec9be7..95f78a4465 100644 --- a/crates/gpui/src/platform/mac/metal_atlas.rs +++ b/crates/gpui/src/platform/mac/metal_atlas.rs @@ -3,7 +3,7 @@ use crate::{ Point, Size, }; use anyhow::Result; -use collections::HashMap; +use collections::FxHashMap; use derive_more::{Deref, DerefMut}; use etagere::BucketedAtlasAllocator; use metal::Device; @@ -53,7 +53,7 @@ struct MetalAtlasState { monochrome_textures: Vec, polychrome_textures: Vec, path_textures: Vec, - tiles_by_key: HashMap, + tiles_by_key: FxHashMap, } impl PlatformAtlas for MetalAtlas { diff --git a/crates/gpui/src/scene.rs b/crates/gpui/src/scene.rs index dfd51c7bc7..d5d717e278 100644 --- a/crates/gpui/src/scene.rs +++ b/crates/gpui/src/scene.rs @@ -2,7 +2,7 @@ use crate::{ point, AtlasTextureId, AtlasTile, Bounds, ContentMask, Corners, Edges, EntityId, Hsla, Pixels, Point, ScaledPixels, StackingOrder, }; -use collections::{BTreeMap, HashSet}; +use collections::{BTreeMap, FxHashSet}; use std::{fmt::Debug, iter::Peekable, slice}; // Exported to metal @@ -159,7 +159,7 @@ impl Scene { layer_id } - pub fn reuse_views(&mut self, views: &HashSet, prev_scene: &mut Self) { + pub fn reuse_views(&mut self, views: &FxHashSet, prev_scene: &mut Self) { for shadow in prev_scene.shadows.drain(..) { if views.contains(&shadow.view_id.into()) { let order = &prev_scene.orders_by_layer[&shadow.layer_id]; diff --git a/crates/gpui/src/taffy.rs b/crates/gpui/src/taffy.rs index 3536d3fa59..0797c8f3b4 100644 --- a/crates/gpui/src/taffy.rs +++ b/crates/gpui/src/taffy.rs @@ -2,7 +2,7 @@ use crate::{ AbsoluteLength, Bounds, DefiniteLength, Edges, Length, Pixels, Point, Size, Style, WindowContext, }; -use collections::{HashMap, HashSet}; +use collections::{FxHashMap, FxHashSet}; use smallvec::SmallVec; use std::fmt::Debug; use taffy::{ @@ -17,11 +17,11 @@ type NodeMeasureFn = pub struct TaffyLayoutEngine { taffy: Taffy, - styles: HashMap, - children_to_parents: HashMap, - absolute_layout_bounds: HashMap>, - computed_layouts: HashSet, - nodes_to_measure: HashMap, + styles: FxHashMap, + children_to_parents: FxHashMap, + absolute_layout_bounds: FxHashMap>, + computed_layouts: FxHashSet, + nodes_to_measure: FxHashMap, } static EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by construction if possible"; @@ -30,11 +30,11 @@ impl TaffyLayoutEngine { pub fn new() -> Self { TaffyLayoutEngine { taffy: Taffy::new(), - styles: HashMap::default(), - children_to_parents: HashMap::default(), - absolute_layout_bounds: HashMap::default(), - computed_layouts: HashSet::default(), - nodes_to_measure: HashMap::default(), + styles: FxHashMap::default(), + children_to_parents: FxHashMap::default(), + absolute_layout_bounds: FxHashMap::default(), + computed_layouts: FxHashSet::default(), + nodes_to_measure: FxHashMap::default(), } } diff --git a/crates/gpui/src/text_system.rs b/crates/gpui/src/text_system.rs index 75d98a8305..12242e26c2 100644 --- a/crates/gpui/src/text_system.rs +++ b/crates/gpui/src/text_system.rs @@ -13,7 +13,7 @@ use crate::{ SharedString, Size, UnderlineStyle, }; use anyhow::anyhow; -use collections::{BTreeSet, HashMap, HashSet}; +use collections::{BTreeSet, FxHashMap, FxHashSet}; use core::fmt; use derive_more::Deref; use itertools::Itertools; @@ -42,10 +42,10 @@ pub(crate) const SUBPIXEL_VARIANTS: u8 = 4; /// The GPUI text rendering sub system. pub struct TextSystem { platform_text_system: Arc, - font_ids_by_font: RwLock>>, - font_metrics: RwLock>, - raster_bounds: RwLock>>, - wrapper_pool: Mutex>>, + font_ids_by_font: RwLock>>, + font_metrics: RwLock>, + raster_bounds: RwLock>>, + wrapper_pool: Mutex>>, font_runs_pool: Mutex>>, fallback_font_stack: SmallVec<[Font; 2]>, } @@ -447,7 +447,7 @@ impl WindowTextSystem { Ok(lines) } - pub(crate) fn finish_frame(&self, reused_views: &HashSet) { + pub(crate) fn finish_frame(&self, reused_views: &FxHashSet) { self.line_layout_cache.finish_frame(reused_views) } diff --git a/crates/gpui/src/text_system/line_layout.rs b/crates/gpui/src/text_system/line_layout.rs index 144f855c56..014c2bb1ec 100644 --- a/crates/gpui/src/text_system/line_layout.rs +++ b/crates/gpui/src/text_system/line_layout.rs @@ -1,5 +1,5 @@ use crate::{px, EntityId, FontId, GlyphId, Pixels, PlatformTextSystem, Point, Size}; -use collections::{HashMap, HashSet}; +use collections::{FxHashMap, FxHashSet}; use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard}; use smallvec::SmallVec; use std::{ @@ -277,10 +277,10 @@ impl WrappedLineLayout { pub(crate) struct LineLayoutCache { view_stack: Mutex>, - previous_frame: Mutex>>, - current_frame: RwLock>>, - previous_frame_wrapped: Mutex>>, - current_frame_wrapped: RwLock>>, + previous_frame: Mutex>>, + current_frame: RwLock>>, + previous_frame_wrapped: Mutex>>, + current_frame_wrapped: RwLock>>, platform_text_system: Arc, } @@ -296,7 +296,7 @@ impl LineLayoutCache { } } - pub fn finish_frame(&self, reused_views: &HashSet) { + pub fn finish_frame(&self, reused_views: &FxHashSet) { debug_assert_eq!(self.view_stack.lock().len(), 0); let mut prev_frame = self.previous_frame.lock(); diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 429ea0dbe2..4b7c43e113 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -10,7 +10,7 @@ use crate::{ WindowOptions, WindowTextSystem, }; use anyhow::{anyhow, Context as _, Result}; -use collections::HashSet; +use collections::FxHashSet; use derive_more::{Deref, DerefMut}; use futures::{ channel::{mpsc, oneshot}, @@ -259,7 +259,7 @@ pub struct Window { pub(crate) element_id_stack: GlobalElementId, pub(crate) rendered_frame: Frame, pub(crate) next_frame: Frame, - pub(crate) dirty_views: HashSet, + pub(crate) dirty_views: FxHashSet, pub(crate) focus_handles: Arc>>, focus_listeners: SubscriberSet<(), AnyWindowFocusListener>, focus_lost_listeners: SubscriberSet<(), AnyObserver>, @@ -428,7 +428,7 @@ impl Window { element_id_stack: GlobalElementId::default(), rendered_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), next_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), - dirty_views: HashSet::default(), + dirty_views: FxHashSet::default(), focus_handles: Arc::new(RwLock::new(SlotMap::with_key())), focus_listeners: SubscriberSet::new(), focus_lost_listeners: SubscriberSet::new(), diff --git a/crates/gpui/src/window/element_cx.rs b/crates/gpui/src/window/element_cx.rs index a1e96af5ff..8ba3fc5c4f 100644 --- a/crates/gpui/src/window/element_cx.rs +++ b/crates/gpui/src/window/element_cx.rs @@ -21,7 +21,7 @@ use std::{ }; use anyhow::Result; -use collections::{HashMap, HashSet}; +use collections::{FxHashMap, FxHashSet}; use derive_more::{Deref, DerefMut}; use media::core_video::CVImageBuffer; use smallvec::SmallVec; @@ -53,8 +53,8 @@ pub(crate) struct TooltipRequest { pub(crate) struct Frame { pub(crate) focus: Option, pub(crate) window_active: bool, - pub(crate) element_states: HashMap, - pub(crate) mouse_listeners: HashMap>, + pub(crate) element_states: FxHashMap, + pub(crate) mouse_listeners: FxHashMap>, pub(crate) dispatch_tree: DispatchTree, pub(crate) scene: Scene, pub(crate) depth_map: Vec<(StackingOrder, EntityId, Bounds)>, @@ -65,13 +65,13 @@ pub(crate) struct Frame { pub(crate) element_offset_stack: Vec>, pub(crate) requested_input_handler: Option, pub(crate) tooltip_request: Option, - pub(crate) cursor_styles: HashMap, + pub(crate) cursor_styles: FxHashMap, pub(crate) requested_cursor_style: Option, pub(crate) view_stack: Vec, - pub(crate) reused_views: HashSet, + pub(crate) reused_views: FxHashSet, #[cfg(any(test, feature = "test-support"))] - pub(crate) debug_bounds: collections::HashMap>, + pub(crate) debug_bounds: collections::FxHashMap>, } impl Frame { @@ -79,8 +79,8 @@ impl Frame { Frame { focus: None, window_active: false, - element_states: HashMap::default(), - mouse_listeners: HashMap::default(), + element_states: FxHashMap::default(), + mouse_listeners: FxHashMap::default(), dispatch_tree, scene: Scene::default(), depth_map: Vec::new(), @@ -91,13 +91,13 @@ impl Frame { element_offset_stack: Vec::new(), requested_input_handler: None, tooltip_request: None, - cursor_styles: HashMap::default(), + cursor_styles: FxHashMap::default(), requested_cursor_style: None, view_stack: Vec::new(), - reused_views: HashSet::default(), + reused_views: FxHashSet::default(), #[cfg(any(test, feature = "test-support"))] - debug_bounds: HashMap::default(), + debug_bounds: FxHashMap::default(), } } diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 3744a36c00..b43b5d8413 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -8,7 +8,6 @@ use editor::{actions::Cancel, scroll::Autoscroll, Editor}; use file_associations::FileAssociations; use anyhow::{anyhow, Result}; -use collections::{hash_map, HashMap}; use gpui::{ actions, div, overlay, px, uniform_list, Action, AppContext, AssetSource, AsyncWindowContext, ClipboardItem, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, InteractiveElement, @@ -23,7 +22,14 @@ use project::{ }; use project_panel_settings::{ProjectPanelDockPosition, ProjectPanelSettings}; use serde::{Deserialize, Serialize}; -use std::{cmp::Ordering, ffi::OsStr, ops::Range, path::Path, sync::Arc}; +use std::{ + cmp::Ordering, + collections::{hash_map, HashMap}, + ffi::OsStr, + ops::Range, + path::Path, + sync::Arc, +}; use theme::ThemeSettings; use ui::{prelude::*, v_flex, ContextMenu, Icon, KeyBinding, Label, ListItem}; use unicase::UniCase; @@ -1693,13 +1699,15 @@ impl ClipboardEntry { #[cfg(test)] mod tests { use super::*; - use collections::HashSet; use gpui::{TestAppContext, View, VisualTestContext, WindowHandle}; use pretty_assertions::assert_eq; use project::{project_settings::ProjectSettings, FakeFs}; use serde_json::json; use settings::SettingsStore; - use std::path::{Path, PathBuf}; + use std::{ + collections::HashSet, + path::{Path, PathBuf}, + }; use workspace::AppState; #[gpui::test] @@ -3501,7 +3509,7 @@ mod tests { cx: &mut VisualTestContext, ) -> Vec { let mut result = Vec::new(); - let mut project_entries = HashSet::default(); + let mut project_entries = HashSet::new(); let mut has_editor = false; panel.update(cx, |panel, cx| { diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index c450293945..89f94ad6c4 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -25,11 +25,11 @@ use project::{ }; use semantic_index::{SemanticIndex, SemanticIndexStatus}; -use collections::HashSet; use settings::Settings; use smol::stream::StreamExt; use std::{ any::{Any, TypeId}, + collections::HashSet, mem, ops::{Not, Range}, path::PathBuf, @@ -955,7 +955,7 @@ impl ProjectSearchView { semantic_state: None, semantic_permissioned: None, search_options: options, - panels_with_errors: HashSet::default(), + panels_with_errors: HashSet::new(), active_match_index: None, query_editor_was_focused: false, included_files_editor, diff --git a/crates/semantic_index/src/parsing.rs b/crates/semantic_index/src/parsing.rs index e6f4a37d10..9f2db711ae 100644 --- a/crates/semantic_index/src/parsing.rs +++ b/crates/semantic_index/src/parsing.rs @@ -3,7 +3,6 @@ use ai::{ models::TruncationDirection, }; use anyhow::{anyhow, Result}; -use collections::HashSet; use language::{Grammar, Language}; use rusqlite::{ types::{FromSql, FromSqlResult, ToSqlOutput, ValueRef}, @@ -13,6 +12,7 @@ use sha1::{Digest, Sha1}; use std::{ borrow::Cow, cmp::{self, Reverse}, + collections::HashSet, ops::Range, path::Path, sync::Arc, @@ -267,7 +267,7 @@ impl CodeContextRetriever { let mut spans = Vec::new(); let mut collapsed_ranges_within = Vec::new(); - let mut parsed_name_ranges = HashSet::default(); + let mut parsed_name_ranges = HashSet::new(); for (i, context_match) in matches.iter().enumerate() { // Items which are collapsible but not embeddable have no item range let item_range = if let Some(item_range) = context_match.item_range.clone() { diff --git a/crates/sqlez/Cargo.toml b/crates/sqlez/Cargo.toml index 71c67af095..2ee5e6cbf3 100644 --- a/crates/sqlez/Cargo.toml +++ b/crates/sqlez/Cargo.toml @@ -7,7 +7,6 @@ license = "GPL-3.0-or-later" [dependencies] anyhow.workspace = true -collections.workspace = true futures.workspace = true indoc.workspace = true lazy_static.workspace = true diff --git a/crates/sqlez/src/thread_safe_connection.rs b/crates/sqlez/src/thread_safe_connection.rs index cd4664c9ae..98402df108 100644 --- a/crates/sqlez/src/thread_safe_connection.rs +++ b/crates/sqlez/src/thread_safe_connection.rs @@ -1,9 +1,8 @@ use anyhow::Context; -use collections::HashMap; use futures::{channel::oneshot, Future, FutureExt}; use lazy_static::lazy_static; use parking_lot::{Mutex, RwLock}; -use std::{marker::PhantomData, ops::Deref, sync::Arc, thread}; +use std::{collections::HashMap, marker::PhantomData, ops::Deref, sync::Arc, thread}; use thread_local::ThreadLocal; use crate::{connection::Connection, domain::Migrator, util::UnboundedSyncSender}; diff --git a/crates/terminal/Cargo.toml b/crates/terminal/Cargo.toml index a52a7c6f93..7f12fc6eb7 100644 --- a/crates/terminal/Cargo.toml +++ b/crates/terminal/Cargo.toml @@ -13,7 +13,6 @@ doctest = false [dependencies] alacritty_terminal = "0.22.0" anyhow.workspace = true -collections.workspace = true db.workspace = true dirs = "4.0.0" futures.workspace = true diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 46c7cb0c19..ad9587a326 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -30,7 +30,6 @@ use mappings::mouse::{ scroll_report, }; -use collections::{HashMap, VecDeque}; use procinfo::LocalProcessInfo; use serde::{Deserialize, Serialize}; use settings::Settings; @@ -40,6 +39,7 @@ use util::truncate_and_trailoff; use std::{ cmp::{self, min}, + collections::{HashMap, VecDeque}, fmt::Display, ops::{Deref, Index, RangeInclusive}, os::unix::prelude::AsRawFd, diff --git a/crates/terminal/src/terminal_settings.rs b/crates/terminal/src/terminal_settings.rs index 1a072ca8bc..7b3d97145c 100644 --- a/crates/terminal/src/terminal_settings.rs +++ b/crates/terminal/src/terminal_settings.rs @@ -1,4 +1,3 @@ -use collections::HashMap; use gpui::{px, AbsoluteLength, AppContext, FontFeatures, Pixels}; use schemars::{ gen::SchemaGenerator, @@ -8,7 +7,7 @@ use schemars::{ use serde_derive::{Deserialize, Serialize}; use serde_json::Value; use settings::SettingsJsonSchemaParams; -use std::path::PathBuf; +use std::{collections::HashMap, path::PathBuf}; #[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] #[serde(rename_all = "snake_case")] diff --git a/crates/theme/Cargo.toml b/crates/theme/Cargo.toml index c060627ad6..8970cfbacf 100644 --- a/crates/theme/Cargo.toml +++ b/crates/theme/Cargo.toml @@ -8,7 +8,11 @@ license = "GPL-3.0-or-later" [features] default = [] stories = ["dep:itertools", "dep:story"] -test-support = ["gpui/test-support", "fs/test-support", "settings/test-support"] +test-support = [ + "gpui/test-support", + "fs/test-support", + "settings/test-support" +] [lib] path = "src/theme.rs" @@ -16,7 +20,6 @@ doctest = false [dependencies] anyhow.workspace = true -collections.workspace = true color.workspace = true derive_more.workspace = true fs.workspace = true diff --git a/crates/theme/src/registry.rs b/crates/theme/src/registry.rs index 2cc4d902a2..fac119ff1d 100644 --- a/crates/theme/src/registry.rs +++ b/crates/theme/src/registry.rs @@ -1,8 +1,8 @@ +use std::collections::HashMap; use std::path::Path; use std::sync::Arc; use anyhow::{anyhow, Context, Result}; -use collections::HashMap; use derive_more::{Deref, DerefMut}; use fs::Fs; use futures::StreamExt; @@ -64,7 +64,7 @@ impl ThemeRegistry { pub fn new(assets: Box) -> Self { let registry = Self { state: RwLock::new(ThemeRegistryState { - themes: HashMap::default(), + themes: HashMap::new(), }), assets, }; diff --git a/crates/util/Cargo.toml b/crates/util/Cargo.toml index fc06ebeb4a..c510d6f557 100644 --- a/crates/util/Cargo.toml +++ b/crates/util/Cargo.toml @@ -15,7 +15,6 @@ test-support = ["tempfile", "git2"] [dependencies] anyhow.workspace = true backtrace = "0.3" -collections.workspace = true dirs = "3.0" futures.workspace = true git2 = { workspace = true, optional = true } diff --git a/crates/util/src/test/marked_text.rs b/crates/util/src/test/marked_text.rs index cf85a806e4..dadf78622d 100644 --- a/crates/util/src/test/marked_text.rs +++ b/crates/util/src/test/marked_text.rs @@ -1,5 +1,4 @@ -use collections::HashMap; -use std::{cmp::Ordering, ops::Range}; +use std::{cmp::Ordering, collections::HashMap, ops::Range}; /// Construct a string and a list of offsets within that string using a single /// string containing embedded position markers. diff --git a/crates/zed/src/open_listener.rs b/crates/zed/src/open_listener.rs index d3ccf753d1..012b5a2413 100644 --- a/crates/zed/src/open_listener.rs +++ b/crates/zed/src/open_listener.rs @@ -1,7 +1,6 @@ use anyhow::{anyhow, Context, Result}; use cli::{ipc, IpcHandshake}; use cli::{ipc::IpcSender, CliRequest, CliResponse}; -use collections::HashMap; use editor::scroll::Autoscroll; use editor::Editor; use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender}; @@ -11,6 +10,7 @@ use gpui::{AppContext, AsyncAppContext, Global}; use itertools::Itertools; use language::{Bias, Point}; use release_channel::parse_zed_link; +use std::collections::HashMap; use std::ffi::OsStr; use std::os::unix::prelude::OsStrExt; use std::path::Path; @@ -176,7 +176,7 @@ pub async fn handle_cli_connection( if let Some(request) = requests.next().await { match request { CliRequest::Open { paths, wait } => { - let mut caret_positions = HashMap::default(); + let mut caret_positions = HashMap::new(); let paths = if paths.is_empty() { workspace::last_opened_workspace_paths() diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index b4ec471113..443adac50d 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -733,7 +733,6 @@ fn open_settings_file( mod tests { use super::*; use assets::Assets; - use collections::HashSet; use editor::{scroll::Autoscroll, DisplayPoint, Editor}; use gpui::{ actions, Action, AnyWindowHandle, AppContext, AssetSource, Entity, TestAppContext, @@ -743,7 +742,10 @@ mod tests { use project::{project_settings::ProjectSettings, Project, ProjectPath}; use serde_json::json; use settings::{handle_settings_file_changes, watch_config_file, SettingsStore}; - use std::path::{Path, PathBuf}; + use std::{ + collections::HashSet, + path::{Path, PathBuf}, + }; use theme::{ThemeRegistry, ThemeSettings}; use workspace::{ item::{Item, ItemHandle},