From 16626592dba30f9572e8957221ef5eff33673f86 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 26 Dec 2023 01:23:08 +0100 Subject: [PATCH] Remove allow unused from gpui2, vim2 tests and terminal_view2 (#3813) Release Notes: - N/A --- crates/gpui2/src/color.rs | 2 -- crates/terminal_view2/src/terminal_element.rs | 14 +++----------- crates/terminal_view2/src/terminal_view.rs | 15 ++++----------- .../test/neovim_backed_binding_test_context.rs | 3 --- .../vim2/src/test/neovim_backed_test_context.rs | 5 +---- crates/vim2/src/test/vim_test_context.rs | 3 --- 6 files changed, 8 insertions(+), 34 deletions(-) diff --git a/crates/gpui2/src/color.rs b/crates/gpui2/src/color.rs index 44a0e917be..d5514d900f 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 eb7348b935..fc87ac45bd 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)>, ) -> 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) -> Option { + fn text_for_range(&mut self, _: std::ops::Range) -> Option { None } diff --git a/crates/terminal_view2/src/terminal_view.rs b/crates/terminal_view2/src/terminal_view.rs index f82a43959b..6d18d6f8f9 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::(cx); - cx.observe_new_views( - |workspace: &mut Workspace, cx: &mut ViewContext| { - 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 { - 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, cx: &mut ViewContext, ) { - 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::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 3b97cb2b16..15fce99aad 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 21455de552..7380537655 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 3956964480..47afc20785 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::{