From 3c49011d084bbfb13bb37edd7e3a3d298c972224 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:48:42 +0100 Subject: [PATCH] Fix up warnings (automatic) --- crates/search2/src/project_search.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/crates/search2/src/project_search.rs b/crates/search2/src/project_search.rs index df9088063a..be39bb030b 100644 --- a/crates/search2/src/project_search.rs +++ b/crates/search2/src/project_search.rs @@ -1,7 +1,6 @@ use crate::{ history::SearchHistory, mode::SearchMode, - search_bar::{render_nav_button, render_search_mode_button}, ActivateRegexMode, ActivateSemanticMode, ActivateTextMode, CycleMode, NextHistoryQuery, PreviousHistoryQuery, ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPrevMatch, ToggleCaseSensitive, ToggleReplace, ToggleWholeWord, @@ -24,21 +23,19 @@ use project::{ Entry, Project, }; use semantic_index::{SemanticIndex, SemanticIndexStatus}; -use smallvec::SmallVec; + use smol::stream::StreamExt; use std::{ any::{Any, TypeId}, - borrow::Cow, collections::HashSet, mem, ops::{Not, Range}, path::PathBuf, - sync::Arc, - time::{Duration, Instant}, + time::{Duration}, }; -use theme::ActiveTheme; + use ui::{ - h_stack, v_stack, Button, ButtonCommon, Clickable, Color, Disableable, Icon, IconButton, + h_stack, v_stack, Button, ButtonCommon, Clickable, Disableable, Icon, IconButton, IconElement, Label, LabelCommon, LabelSize, Selectable, Tooltip, }; use util::{paths::PathMatcher, ResultExt as _}; @@ -61,7 +58,7 @@ pub fn init(cx: &mut AppContext) { // todo!() po cx.set_global(ActiveSearches::default()); cx.set_global(ActiveSettings::default()); - cx.observe_new_views(|workspace: &mut Workspace, cx| { + cx.observe_new_views(|workspace: &mut Workspace, _cx| { workspace.register_action(ProjectSearchView::deploy); }) .detach(); @@ -97,7 +94,7 @@ pub fn init(cx: &mut AppContext) { // add_toggle_filters_action::(cx); } -fn add_toggle_filters_action(cx: &mut AppContext) { +fn add_toggle_filters_action(_cx: &mut AppContext) { // todo!() po // cx.register_action(move |pane: &mut Pane, _: &A, cx: &mut ViewContext| { // if let Some(search_bar) = pane.toolbar().read(cx).item_of_type::() { @@ -109,7 +106,7 @@ fn add_toggle_filters_action(cx: &mut AppContext) { // }); } -fn add_toggle_option_action(option: SearchOptions, cx: &mut AppContext) { +fn add_toggle_option_action(_option: SearchOptions, _cx: &mut AppContext) { // todo!() po // cx.add_action(move |pane: &mut Pane, _: &A, cx: &mut ViewContext| { // if let Some(search_bar) = pane.toolbar().read(cx).item_of_type::() { @@ -811,7 +808,7 @@ impl ProjectSearchView { let has_permission = has_permission.await?; if !has_permission { - let mut answer = this.update(&mut cx, |this, cx| { + let answer = this.update(&mut cx, |this, cx| { let project = this.model.read(cx).project.clone(); let project_name = project .read(cx) @@ -1069,7 +1066,7 @@ impl ProjectSearchView { cx: &mut ViewContext, ) { // Clean up entries for dropped projects - cx.update_global(|state: &mut ActiveSearches, cx| { + cx.update_global(|state: &mut ActiveSearches, _cx| { state.0.retain(|project, _| project.is_upgradable()) });