From ae1ebc68583f19cb23c679cb6f2dd62653b464a2 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 17 Nov 2023 17:22:52 +0100 Subject: [PATCH] fixup! Remove dead code (for now). --- crates/search2/src/mode.rs | 11 ++++------- crates/search2/src/search_bar.rs | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/search2/src/mode.rs b/crates/search2/src/mode.rs index 4b036d29a5..817fb454d2 100644 --- a/crates/search2/src/mode.rs +++ b/crates/search2/src/mode.rs @@ -1,6 +1,3 @@ -use gpui::Action; - -use crate::{ActivateRegexMode, ActivateSemanticMode, ActivateTextMode}; // TODO: Update the default search mode to get from config #[derive(Copy, Clone, Debug, Default, PartialEq)] pub enum SearchMode { @@ -11,11 +8,11 @@ pub enum SearchMode { } impl SearchMode { - pub(crate) fn activate_action(&self) -> Box { + pub(crate) fn label(&self) -> &'static str { match self { - SearchMode::Text => Box::new(ActivateTextMode), - SearchMode::Semantic => Box::new(ActivateSemanticMode), - SearchMode::Regex => Box::new(ActivateRegexMode), + SearchMode::Text => "Text", + SearchMode::Semantic => "Semantic", + SearchMode::Regex => "Regex", } } } diff --git a/crates/search2/src/search_bar.rs b/crates/search2/src/search_bar.rs index cd3b5e474b..1c4f2a17a6 100644 --- a/crates/search2/src/search_bar.rs +++ b/crates/search2/src/search_bar.rs @@ -1,6 +1,6 @@ -use std::{borrow::Cow, sync::Arc}; +use std::sync::Arc; -use gpui::{div, Action, Component, ViewContext}; +use gpui::{Component, ViewContext}; use ui::{Button, ButtonVariant, IconButton}; use crate::mode::SearchMode;