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

Piotr Osiewicz created

Release Notes:

- N/A

Change summary

crates/gpui2/src/color.rs                                  |  2 -
crates/terminal_view2/src/terminal_element.rs              | 14 +-----
crates/terminal_view2/src/terminal_view.rs                 | 15 ++-----
crates/vim2/src/test/neovim_backed_binding_test_context.rs |  3 -
crates/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(-)

Detailed changes

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;

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
     }
 

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()

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::{