Remove small pieces of unused code
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -28,11 +28,6 @@ impl<T: Operation> OperationQueue<T> {
|
||||
OperationQueue(SumTree::new())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.0.summary().len
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<Workspace> {
|
||||
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()
|
||||
|
||||
@@ -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(())
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user