diff --git a/gpui/src/platform/mac/mod.rs b/gpui/src/platform/mac/mod.rs index fc52d0f418..b7a19c3647 100644 --- a/gpui/src/platform/mac/mod.rs +++ b/gpui/src/platform/mac/mod.rs @@ -24,6 +24,7 @@ pub fn app() -> impl platform::App { pub fn runner() -> impl platform::Runner { Runner::new() } + trait BoolExt { fn to_objc(self) -> BOOL; } diff --git a/gpui/src/platform/mac/window.rs b/gpui/src/platform/mac/window.rs index 0ae27ec66c..cf4c617512 100644 --- a/gpui/src/platform/mac/window.rs +++ b/gpui/src/platform/mac/window.rs @@ -126,7 +126,6 @@ struct WindowState { scene_to_render: Option, renderer: Renderer, command_queue: metal::CommandQueue, - device: metal::Device, layer: id, } @@ -189,7 +188,6 @@ impl Window { scene_to_render: Default::default(), renderer: Renderer::new(device.clone(), PIXEL_FORMAT, fonts)?, command_queue: device.new_command_queue(), - device, layer, }))); @@ -426,7 +424,6 @@ extern "C" fn display_layer(this: &Object, _: Sel, _: id) { let size = window_state.size(); let scale_factor = window_state.scale_factor(); - let device = window_state.device.clone(); window_state.renderer.render( &scene, diff --git a/gpui/src/scene.rs b/gpui/src/scene.rs index 49d56b0007..d002804dae 100644 --- a/gpui/src/scene.rs +++ b/gpui/src/scene.rs @@ -221,10 +221,6 @@ impl Border { self } - fn all_sides(&self) -> bool { - self.top && self.left && self.bottom && self.right - } - pub fn top_width(&self) -> f32 { if self.top { self.width diff --git a/zed/src/editor/buffer/mod.rs b/zed/src/editor/buffer/mod.rs index 1d476ceb27..94d24f508a 100644 --- a/zed/src/editor/buffer/mod.rs +++ b/zed/src/editor/buffer/mod.rs @@ -1650,10 +1650,6 @@ impl Fragment { self.text = self.insertion.text.slice(self.start_offset()..offset); } - fn as_str(&self) -> &str { - self.text.as_str() - } - fn visible_len(&self) -> usize { if self.is_visible() { self.len() diff --git a/zed/src/editor/buffer_element.rs b/zed/src/editor/buffer_element.rs index ebb8ecfe79..a4a9d63a33 100644 --- a/zed/src/editor/buffer_element.rs +++ b/zed/src/editor/buffer_element.rs @@ -8,7 +8,7 @@ use gpui::{ }, text_layout::{self, TextLayoutCache}, AfterLayoutContext, AppContext, Border, Element, Event, EventContext, FontCache, LayoutContext, - MutableAppContext, PaintContext, Quad, Scene, SizeConstraint, ViewHandle, + PaintContext, Quad, Scene, SizeConstraint, ViewHandle, }; use smallvec::SmallVec; use std::cmp::Ordering; diff --git a/zed/src/editor/buffer_view.rs b/zed/src/editor/buffer_view.rs index 7b5f1270f3..7d538b88f4 100644 --- a/zed/src/editor/buffer_view.rs +++ b/zed/src/editor/buffer_view.rs @@ -4,7 +4,6 @@ use super::{ }; use crate::{settings::Settings, watch, workspace}; use anyhow::Result; -use easy_parallel::Parallel; use gpui::{ fonts::Properties as FontProperties, keymap::Binding, text_layout, App, AppContext, Element, ElementBox, Entity, FontCache, ModelHandle, View, ViewContext, WeakViewHandle, diff --git a/zed/src/operation_queue.rs b/zed/src/operation_queue.rs index e3a0532332..baad04b0bf 100644 --- a/zed/src/operation_queue.rs +++ b/zed/src/operation_queue.rs @@ -28,11 +28,6 @@ impl OperationQueue { OperationQueue(SumTree::new()) } - #[cfg(test)] - pub fn is_empty(&self) -> bool { - self.0.is_empty() - } - pub fn len(&self) -> usize { self.0.summary().len } diff --git a/zed/src/util.rs b/zed/src/util.rs index 80ff736d24..70f2b1a6d6 100644 --- a/zed/src/util.rs +++ b/zed/src/util.rs @@ -1,11 +1,6 @@ use rand::prelude::*; use std::cmp::Ordering; -pub fn pre_inc(value: &mut usize) -> usize { - *value += 1; - *value -} - pub fn post_inc(value: &mut usize) -> usize { let prev = *value; *value += 1; diff --git a/zed/src/workspace/workspace.rs b/zed/src/workspace/workspace.rs index 53c5088122..092144791c 100644 --- a/zed/src/workspace/workspace.rs +++ b/zed/src/workspace/workspace.rs @@ -7,9 +7,7 @@ use crate::{ worktree::{Worktree, WorktreeHandle as _}, }; use anyhow::anyhow; -use gpui::{ - App, AppContext, Entity, Handle, ModelContext, ModelHandle, MutableAppContext, ViewContext, -}; +use gpui::{AppContext, Entity, Handle, ModelContext, ModelHandle, MutableAppContext, ViewContext}; use smol::prelude::*; use std::{ collections::{HashMap, HashSet}, @@ -202,12 +200,12 @@ impl Entity for Workspace { #[cfg(test)] pub trait WorkspaceHandle { - fn file_entries(&self, app: &App) -> Vec<(usize, usize)>; + fn file_entries(&self, app: &gpui::App) -> Vec<(usize, usize)>; } #[cfg(test)] impl WorkspaceHandle for ModelHandle { - fn file_entries(&self, app: &App) -> Vec<(usize, usize)> { + fn file_entries(&self, app: &gpui::App) -> Vec<(usize, usize)> { self.read(&app, |w, app| { w.worktrees() .iter() diff --git a/zed/src/worktree/worktree.rs b/zed/src/worktree/worktree.rs index ab8d41c46b..f4c956508d 100644 --- a/zed/src/worktree/worktree.rs +++ b/zed/src/worktree/worktree.rs @@ -60,10 +60,8 @@ impl Worktree { tree.0.write().scanning = true; let tree = tree.clone(); - let (tx, rx) = smol::channel::bounded(1); - let task = ctx.background_executor().spawn(async move { - let _ = tx.send(tree.scan_dirs()?).await; + tree.scan_dirs()?; Ok(()) });