Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Remove allow unused from gpui2, vim2 tests and terminal_view2 (#3813)

Piotr Osiewicz16626592dba3
diff --git a/crates/gpui2/src/color.rs b/crates/gpui2/src/color.rs
index 44a0e917be2..d5514d900ff 100644
--- a/crates/gpui2/src/color.rs
+++ b/crates/gpui2/src/color.rs
@@ -1,5 +1,3 @@
-#![allow(dead_code)]
-
use anyhow::bail;
use serde::de::{self, Deserialize, Deserializer, Visitor};
use std::fmt;
diff --git a/crates/terminal_view2/src/terminal_element.rs b/crates/terminal_view2/src/terminal_element.rs
index eb7348b9357..fc87ac45bd9 100644
--- a/crates/terminal_view2/src/terminal_element.rs
+++ b/crates/terminal_view2/src/terminal_element.rs
@@ -248,14 +248,8 @@ impl TerminalElement {
{
let cell_text = cell.c.to_string();
if !is_blank(&cell) {
- let cell_style = TerminalElement::cell_style(
- &cell,
- fg,
- theme,
- text_style,
- text_system,
- hyperlink,
- );
+ let cell_style =
+ TerminalElement::cell_style(&cell, fg, theme, text_style, hyperlink);
let layout_cell = text_system
.shape_line(
@@ -315,7 +309,6 @@ impl TerminalElement {
// bg: terminal::alacritty_terminal::ansi::Color,
colors: &Theme,
text_style: &TextStyle,
- text_system: &TextSystem,
hyperlink: Option<(HighlightStyle, &RangeInclusive<AlacPoint>)>,
) -> TextRun {
let flags = indexed.cell.flags;
@@ -392,7 +385,6 @@ impl TerminalElement {
let font_size =
font_size.map_or(buffer_font_size, |size| theme::adjusted_font_size(size, cx));
- let settings = ThemeSettings::get_global(cx);
let theme = cx.theme().clone();
let link_style = HighlightStyle {
@@ -898,7 +890,7 @@ impl PlatformInputHandler for TerminalInputHandler {
None
}
- fn text_for_range(&mut self, range_utf16: std::ops::Range<usize>) -> Option<String> {
+ fn text_for_range(&mut self, _: std::ops::Range<usize>) -> Option<String> {
None
}
diff --git a/crates/terminal_view2/src/terminal_view.rs b/crates/terminal_view2/src/terminal_view.rs
index f82a43959bc..6d18d6f8f95 100644
--- a/crates/terminal_view2/src/terminal_view.rs
+++ b/crates/terminal_view2/src/terminal_view.rs
@@ -1,6 +1,3 @@
-#![allow(unused_variables)]
-//todo!(remove)
-
mod persistence;
pub mod terminal_element;
pub mod terminal_panel;
@@ -68,11 +65,9 @@ pub fn init(cx: &mut AppContext) {
register_deserializable_item::<TerminalView>(cx);
- cx.observe_new_views(
- |workspace: &mut Workspace, cx: &mut ViewContext<Workspace>| {
- workspace.register_action(TerminalView::deploy);
- },
- )
+ cx.observe_new_views(|workspace: &mut Workspace, _| {
+ workspace.register_action(TerminalView::deploy);
+ })
.detach();
}
@@ -141,7 +136,6 @@ impl TerminalView {
workspace_id: WorkspaceId,
cx: &mut ViewContext<Self>,
) -> Self {
- let view_id = cx.entity_id();
cx.observe(&terminal, |_, _, cx| cx.notify()).detach();
cx.subscribe(&terminal, move |this, _, event, cx| match event {
Event::Wakeup => {
@@ -308,7 +302,7 @@ impl TerminalView {
position: gpui::Point<Pixels>,
cx: &mut ViewContext<Self>,
) {
- let context_menu = ContextMenu::build(cx, |menu, cx| {
+ let context_menu = ContextMenu::build(cx, |menu, _| {
menu.action("Clear", Box::new(Clear))
.action("Close", Box::new(CloseActiveItem { save_intent: None }))
});
@@ -628,7 +622,6 @@ impl Render for TerminalView {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let terminal_handle = self.terminal.clone();
- let self_id = cx.entity_id();
let focused = self.focus_handle.is_focused(cx);
div()
diff --git a/crates/vim2/src/test/neovim_backed_binding_test_context.rs b/crates/vim2/src/test/neovim_backed_binding_test_context.rs
index 3b97cb2b16e..15fce99aad3 100644
--- a/crates/vim2/src/test/neovim_backed_binding_test_context.rs
+++ b/crates/vim2/src/test/neovim_backed_binding_test_context.rs
@@ -1,6 +1,3 @@
-#![allow(unused)]
-// todo!()
-
use std::ops::{Deref, DerefMut};
use crate::state::Mode;
diff --git a/crates/vim2/src/test/neovim_backed_test_context.rs b/crates/vim2/src/test/neovim_backed_test_context.rs
index 21455de5529..7380537655b 100644
--- a/crates/vim2/src/test/neovim_backed_test_context.rs
+++ b/crates/vim2/src/test/neovim_backed_test_context.rs
@@ -1,8 +1,5 @@
-#![allow(unused)]
-// todo!()
-
use editor::{scroll::VERTICAL_SCROLL_MARGIN, test::editor_test_context::ContextHandle};
-use gpui::{point, px, rems, size, Context};
+use gpui::{px, size, Context};
use indoc::indoc;
use settings::SettingsStore;
use std::{
diff --git a/crates/vim2/src/test/vim_test_context.rs b/crates/vim2/src/test/vim_test_context.rs
index 39569644803..47afc20785a 100644
--- a/crates/vim2/src/test/vim_test_context.rs
+++ b/crates/vim2/src/test/vim_test_context.rs
@@ -1,6 +1,3 @@
-#![allow(unused)]
-// todo!()
-
use std::ops::{Deref, DerefMut};
use editor::test::{