From 8136d8a8a6816bc58f29e2882c4f6e143eb8d66d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 6 Apr 2023 15:54:44 -0600 Subject: [PATCH] Fix formatting --- crates/call/src/room.rs | 9 ++------- crates/collab_ui/src/contact_notification.rs | 4 ++-- crates/collab_ui/src/incoming_call_notification.rs | 4 ++-- crates/collab_ui/src/project_shared_notification.rs | 4 ++-- crates/collab_ui/src/sharing_status_indicator.rs | 2 +- crates/command_palette/src/command_palette.rs | 2 +- crates/copilot/src/sign_in.rs | 2 +- crates/diagnostics/src/items.rs | 4 ++-- crates/editor/src/display_map/tab_map.rs | 4 +--- crates/editor/src/scroll.rs | 2 +- crates/editor/src/scroll/actions.rs | 3 +-- crates/feedback/src/feedback.rs | 2 +- crates/recent_projects/src/recent_projects.rs | 4 ++-- crates/staff_mode/src/staff_mode.rs | 10 ++-------- crates/terminal_view/src/terminal_button.rs | 5 ++--- crates/welcome/src/base_keymap_picker.rs | 2 +- crates/welcome/src/welcome.rs | 2 +- crates/workspace/src/notifications.rs | 4 ++-- crates/zed/src/languages/yaml.rs | 5 +---- 19 files changed, 28 insertions(+), 46 deletions(-) diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 98917eaeb6b5153d1927eb1539000765c03a7143..47bd12e3a118f98d3cc5708f9af4c17684f53953 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -10,9 +10,7 @@ use client::{ use collections::{BTreeMap, HashMap, HashSet}; use fs::Fs; use futures::{FutureExt, StreamExt}; -use gpui::{ - AsyncAppContext, Entity, ModelContext, ModelHandle, AppContext, Task, WeakModelHandle, -}; +use gpui::{AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Task, WeakModelHandle}; use language::LanguageRegistry; use live_kit_client::{LocalTrackPublication, LocalVideoTrack, RemoteVideoTrackUpdate}; use postage::stream::Stream; @@ -70,10 +68,7 @@ impl Entity for Room { } } - fn app_will_quit( - &mut self, - cx: &mut AppContext, - ) -> Option>>> { + fn app_will_quit(&mut self, cx: &mut AppContext) -> Option>>> { if self.status.is_online() { let leave = self.leave_internal(cx); Some( diff --git a/crates/collab_ui/src/contact_notification.rs b/crates/collab_ui/src/contact_notification.rs index 4bbba29ce922c652aec6a3d289a97aeb81af361b..5badae695bf699a1d1698fab2df223d58d8ac16c 100644 --- a/crates/collab_ui/src/contact_notification.rs +++ b/crates/collab_ui/src/contact_notification.rs @@ -3,8 +3,8 @@ use std::sync::Arc; use crate::notifications::render_user_notification; use client::{ContactEventKind, User, UserStore}; use gpui::{ - elements::*, impl_internal_actions, Entity, ModelHandle, AppContext, RenderContext, - View, ViewContext, + elements::*, impl_internal_actions, AppContext, Entity, ModelHandle, RenderContext, View, + ViewContext, }; use workspace::notifications::Notification; diff --git a/crates/collab_ui/src/incoming_call_notification.rs b/crates/collab_ui/src/incoming_call_notification.rs index 6254228a956200461c5166e7363b50e3debc1ef4..5917add28080305518070a689870078d701212ef 100644 --- a/crates/collab_ui/src/incoming_call_notification.rs +++ b/crates/collab_ui/src/incoming_call_notification.rs @@ -4,8 +4,8 @@ use futures::StreamExt; use gpui::{ elements::*, geometry::{rect::RectF, vector::vec2f}, - impl_internal_actions, CursorStyle, Entity, MouseButton, AppContext, RenderContext, - View, ViewContext, WindowBounds, WindowKind, WindowOptions, + impl_internal_actions, AppContext, CursorStyle, Entity, MouseButton, RenderContext, View, + ViewContext, WindowBounds, WindowKind, WindowOptions, }; use settings::Settings; use util::ResultExt; diff --git a/crates/collab_ui/src/project_shared_notification.rs b/crates/collab_ui/src/project_shared_notification.rs index 769b89c2bc1c518ebcf3d32c9d9cfc90a0ee7fb7..7e2f1e97b7eaa441064d155cf44bf59c13b756c6 100644 --- a/crates/collab_ui/src/project_shared_notification.rs +++ b/crates/collab_ui/src/project_shared_notification.rs @@ -5,8 +5,8 @@ use gpui::{ actions, elements::*, geometry::{rect::RectF, vector::vec2f}, - CursorStyle, Entity, MouseButton, AppContext, RenderContext, View, ViewContext, - WindowBounds, WindowKind, WindowOptions, + AppContext, CursorStyle, Entity, MouseButton, RenderContext, View, ViewContext, WindowBounds, + WindowKind, WindowOptions, }; use settings::Settings; use std::sync::Arc; diff --git a/crates/collab_ui/src/sharing_status_indicator.rs b/crates/collab_ui/src/sharing_status_indicator.rs index cc77a59367170f6eae33f7fea71745152b9e9413..c9eee05b01efbc69a2e20d859450d6cdf07d227d 100644 --- a/crates/collab_ui/src/sharing_status_indicator.rs +++ b/crates/collab_ui/src/sharing_status_indicator.rs @@ -2,7 +2,7 @@ use call::ActiveCall; use gpui::{ color::Color, elements::{MouseEventHandler, Svg}, - Appearance, Element, ElementBox, Entity, MouseButton, AppContext, RenderContext, View, + AppContext, Appearance, Element, ElementBox, Entity, MouseButton, RenderContext, View, }; use settings::Settings; diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs index a834a17ab6250bc5cecc222dc403661fbffc8f5d..bc49f4f101942e28a056851277378672a8d4c317 100644 --- a/crates/command_palette/src/command_palette.rs +++ b/crates/command_palette/src/command_palette.rs @@ -4,7 +4,7 @@ use gpui::{ actions, elements::{ChildView, Flex, Label, ParentElement}, keymap_matcher::Keystroke, - Action, AnyViewHandle, Element, Entity, MouseState, AppContext, RenderContext, View, + Action, AnyViewHandle, AppContext, Element, Entity, MouseState, RenderContext, View, ViewContext, ViewHandle, }; use picker::{Picker, PickerDelegate}; diff --git a/crates/copilot/src/sign_in.rs b/crates/copilot/src/sign_in.rs index dba1a5e4d8aa2f7c00011488af0698ec4536532c..b9d5305dcb2ff752875481b2c156c8af269a71d5 100644 --- a/crates/copilot/src/sign_in.rs +++ b/crates/copilot/src/sign_in.rs @@ -1,6 +1,6 @@ use crate::{request::PromptUserDeviceFlow, Copilot, Status}; use gpui::{ - elements::*, geometry::rect::RectF, ClipboardItem, Element, Entity, AppContext, View, + elements::*, geometry::rect::RectF, AppContext, ClipboardItem, Element, Entity, View, ViewContext, ViewHandle, WindowKind, WindowOptions, }; use settings::Settings; diff --git a/crates/diagnostics/src/items.rs b/crates/diagnostics/src/items.rs index d96d5fd1fb0f24d289ceeaf3c1cfcaef543792dc..d251d404a0cf559009155606e47eb06753a99a7e 100644 --- a/crates/diagnostics/src/items.rs +++ b/crates/diagnostics/src/items.rs @@ -1,8 +1,8 @@ use collections::HashSet; use editor::{Editor, GoToDiagnostic}; use gpui::{ - elements::*, platform::CursorStyle, serde_json, Entity, ModelHandle, MouseButton, - AppContext, RenderContext, Subscription, View, ViewContext, ViewHandle, WeakViewHandle, + elements::*, platform::CursorStyle, serde_json, AppContext, Entity, ModelHandle, MouseButton, + RenderContext, Subscription, View, ViewContext, ViewHandle, WeakViewHandle, }; use language::Diagnostic; use project::Project; diff --git a/crates/editor/src/display_map/tab_map.rs b/crates/editor/src/display_map/tab_map.rs index e44e345def732f078653608fb8d2768fab1803d7..2932994670ceaca5275215dad5b5335badb5ad38 100644 --- a/crates/editor/src/display_map/tab_map.rs +++ b/crates/editor/src/display_map/tab_map.rs @@ -640,9 +640,7 @@ mod tests { } #[gpui::test] - fn test_long_lines_with_character_spanning_max_expansion_column( - cx: &mut gpui::AppContext, - ) { + fn test_long_lines_with_character_spanning_max_expansion_column(cx: &mut gpui::AppContext) { let max_expansion_column = 8; let input = "abcdefg⋯hij"; diff --git a/crates/editor/src/scroll.rs b/crates/editor/src/scroll.rs index df6188d58e06c0e159f42cdc40a38082546faf15..300d4c88f536d6108e164d3808e757e76f8a3b71 100644 --- a/crates/editor/src/scroll.rs +++ b/crates/editor/src/scroll.rs @@ -9,7 +9,7 @@ use std::{ use gpui::{ geometry::vector::{vec2f, Vector2F}, - Axis, AppContext, Task, ViewContext, + AppContext, Axis, Task, ViewContext, }; use language::{Bias, Point}; use util::ResultExt; diff --git a/crates/editor/src/scroll/actions.rs b/crates/editor/src/scroll/actions.rs index 80b8c1f261063384906f9cad355ad845b15d9428..3b73a4bcbda19b940e14b4bd97875aa81dba32fc 100644 --- a/crates/editor/src/scroll/actions.rs +++ b/crates/editor/src/scroll/actions.rs @@ -1,6 +1,5 @@ use gpui::{ - actions, geometry::vector::Vector2F, impl_internal_actions, Axis, AppContext, - ViewContext, + actions, geometry::vector::Vector2F, impl_internal_actions, AppContext, Axis, ViewContext, }; use language::Bias; diff --git a/crates/feedback/src/feedback.rs b/crates/feedback/src/feedback.rs index 40bebb01700bd533da0ab54b0a2b57b466def386..378c94180d771fa5e2db168c33883920a7aaea4c 100644 --- a/crates/feedback/src/feedback.rs +++ b/crates/feedback/src/feedback.rs @@ -6,7 +6,7 @@ pub mod submit_feedback_button; use std::sync::Arc; mod system_specs; -use gpui::{actions, impl_actions, ClipboardItem, AppContext, PromptLevel, ViewContext}; +use gpui::{actions, impl_actions, AppContext, ClipboardItem, PromptLevel, ViewContext}; use serde::Deserialize; use system_specs::SystemSpecs; use workspace::{AppState, Workspace}; diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index 3cb94ecee7a218dbac8edd77a36c363f77e6f703..58369f4aa5bf5fa9fff28f2e1eefb3c394eedc2b 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -4,8 +4,8 @@ use fuzzy::{StringMatch, StringMatchCandidate}; use gpui::{ actions, elements::{ChildView, Flex, ParentElement}, - AnyViewHandle, Element, ElementBox, Entity, AppContext, RenderContext, Task, View, - ViewContext, ViewHandle, + AnyViewHandle, AppContext, Element, ElementBox, Entity, RenderContext, Task, View, ViewContext, + ViewHandle, }; use highlighted_workspace_location::HighlightedWorkspaceLocation; use ordered_float::OrderedFloat; diff --git a/crates/staff_mode/src/staff_mode.rs b/crates/staff_mode/src/staff_mode.rs index a222aafb02a12196a449114058066e71ce22d6ee..49fadc0b2cccdd64fdf22e8fed1a887de009749e 100644 --- a/crates/staff_mode/src/staff_mode.rs +++ b/crates/staff_mode/src/staff_mode.rs @@ -13,10 +13,7 @@ impl std::ops::Deref for StaffMode { /// Despite what the type system requires me to tell you, the init function will only be called a once /// as soon as we know that the staff mode is enabled. -pub fn staff_mode( - cx: &mut AppContext, - mut init: F, -) { +pub fn staff_mode(cx: &mut AppContext, mut init: F) { if **cx.default_global::() { init(cx) } else { @@ -32,10 +29,7 @@ pub fn staff_mode( /// Immediately checks and runs the init function if the staff mode is not enabled. /// This is only included for symettry with staff_mode() above -pub fn not_staff_mode( - cx: &mut AppContext, - init: F, -) { +pub fn not_staff_mode(cx: &mut AppContext, init: F) { if !**cx.default_global::() { init(cx) } diff --git a/crates/terminal_view/src/terminal_button.rs b/crates/terminal_view/src/terminal_button.rs index 934ba4f107b9d84183bfa1b155171776823bbd27..90f80f67124d60c71c84e9ccdd0cd7a7bef7d515 100644 --- a/crates/terminal_view/src/terminal_button.rs +++ b/crates/terminal_view/src/terminal_button.rs @@ -1,8 +1,7 @@ use context_menu::{ContextMenu, ContextMenuItem}; use gpui::{ - elements::*, impl_internal_actions, CursorStyle, Element, ElementBox, Entity, MouseButton, - AppContext, RenderContext, View, ViewContext, ViewHandle, WeakModelHandle, - WeakViewHandle, + elements::*, impl_internal_actions, AppContext, CursorStyle, Element, ElementBox, Entity, + MouseButton, RenderContext, View, ViewContext, ViewHandle, WeakModelHandle, WeakViewHandle, }; use settings::Settings; use std::any::TypeId; diff --git a/crates/welcome/src/base_keymap_picker.rs b/crates/welcome/src/base_keymap_picker.rs index 01d6d41c6427fbeff424158a8efb18f5be9fd250..8c08a63dc68d54b7aab83935dde67dd8c9bba150 100644 --- a/crates/welcome/src/base_keymap_picker.rs +++ b/crates/welcome/src/base_keymap_picker.rs @@ -2,7 +2,7 @@ use fuzzy::{match_strings, StringMatch, StringMatchCandidate}; use gpui::{ actions, elements::{ChildView, Element as _, Label}, - AnyViewHandle, Entity, AppContext, View, ViewContext, ViewHandle, + AnyViewHandle, AppContext, Entity, View, ViewContext, ViewHandle, }; use picker::{Picker, PickerDelegate}; use settings::{settings_file::SettingsFile, BaseKeymap, Settings}; diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs index b5941903f4fa3930591e2e075d7ac8ecce8d36de..28b0e43c571fac33d7ee835933a584ef683d8da0 100644 --- a/crates/welcome/src/welcome.rs +++ b/crates/welcome/src/welcome.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use db::kvp::KEY_VALUE_STORE; use gpui::{ elements::{Flex, Label, ParentElement}, - Element, ElementBox, Entity, AppContext, Subscription, View, ViewContext, + AppContext, Element, ElementBox, Entity, Subscription, View, ViewContext, }; use settings::{settings_file::SettingsFile, Settings}; diff --git a/crates/workspace/src/notifications.rs b/crates/workspace/src/notifications.rs index 337d1145c03fb473941beb2bc8d4aaeb483af236..207d0497be811a599a4d19efa54e91a028816cee 100644 --- a/crates/workspace/src/notifications.rs +++ b/crates/workspace/src/notifications.rs @@ -1,7 +1,7 @@ use std::{any::TypeId, ops::DerefMut}; use collections::HashSet; -use gpui::{AnyViewHandle, Entity, AppContext, View, ViewContext, ViewHandle}; +use gpui::{AnyViewHandle, AppContext, Entity, View, ViewContext, ViewHandle}; use crate::Workspace; @@ -138,7 +138,7 @@ pub mod simple_message_notification { use gpui::{ actions, elements::{Flex, MouseEventHandler, Padding, ParentElement, Svg, Text}, - impl_actions, Action, CursorStyle, Element, Entity, MouseButton, AppContext, View, + impl_actions, Action, AppContext, CursorStyle, Element, Entity, MouseButton, View, ViewContext, }; use menu::Cancel; diff --git a/crates/zed/src/languages/yaml.rs b/crates/zed/src/languages/yaml.rs index 337c2c065375b06e86146fdab30f89ed5a57874e..fadc74b698279d0b6320bf35c4abd28b666ea7c1 100644 --- a/crates/zed/src/languages/yaml.rs +++ b/crates/zed/src/languages/yaml.rs @@ -99,10 +99,7 @@ impl LspAdapter for YamlLspAdapter { .log_err() } - fn workspace_configuration( - &self, - cx: &mut AppContext, - ) -> Option> { + fn workspace_configuration(&self, cx: &mut AppContext) -> Option> { let settings = cx.global::(); Some( future::ready(serde_json::json!({