From 9afd804062fbfa777fda7840f90c04df93caf055 Mon Sep 17 00:00:00 2001 From: Joseph Lyons Date: Tue, 18 Apr 2023 14:03:02 -0400 Subject: [PATCH] Remove unnecessary lifetimes from `tab_tooltip_text` --- crates/diagnostics/src/diagnostics.rs | 2 +- crates/editor/src/items.rs | 2 +- crates/feedback/src/feedback_editor.rs | 2 +- crates/search/src/project_search.rs | 2 +- crates/terminal_view/src/terminal_view.rs | 2 +- crates/welcome/src/welcome.rs | 2 +- crates/workspace/src/item.rs | 6 +++--- crates/workspace/src/shared_screen.rs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs index d94d82487accc5bb7f9ad49ed16082f6d55a98ca..75a95586bebc4043c62c2ee81a4c3fdd4b0d938d 100644 --- a/crates/diagnostics/src/diagnostics.rs +++ b/crates/diagnostics/src/diagnostics.rs @@ -532,7 +532,7 @@ impl Item for ProjectDiagnosticsEditor { .update(cx, |editor, cx| editor.navigate(data, cx)) } - fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, _: &AppContext) -> Option> { Some("Project Diagnostics".into()) } diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 630b900e275cb72803ae44dfdfd15d033d520c46..64147effff086a2721ba5f7b2c99d537ce9942c9 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -514,7 +514,7 @@ impl Item for Editor { } } - fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, cx: &AppContext) -> Option> { let file_path = self .buffer() .read(cx) diff --git a/crates/feedback/src/feedback_editor.rs b/crates/feedback/src/feedback_editor.rs index c45c29c9894379b9061dea5668f0016bb852f25e..f2d6c54aa74dc8ab37223ef6599a4346624fd4e0 100644 --- a/crates/feedback/src/feedback_editor.rs +++ b/crates/feedback/src/feedback_editor.rs @@ -249,7 +249,7 @@ impl Entity for FeedbackEditor { } impl Item for FeedbackEditor { - fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, _: &AppContext) -> Option> { Some("Send Feedback".into()) } diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index b57561a4cc6fdbea7b35be67f0c1d26c9f82408c..906a0becfdc41e209595f405521f999365d7d4a3 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -226,7 +226,7 @@ impl View for ProjectSearchView { } impl Item for ProjectSearchView { - fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, cx: &AppContext) -> Option> { Some(self.query_editor.read(cx).text(cx).into()) } diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs index 99f15c126e5428a090a06fc8707c0c6278b45ac3..e420a3d5e08dcf714847c11efc412364b00a4df9 100644 --- a/crates/terminal_view/src/terminal_view.rs +++ b/crates/terminal_view/src/terminal_view.rs @@ -544,7 +544,7 @@ impl View for TerminalView { } impl Item for TerminalView { - fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, cx: &AppContext) -> Option> { Some(self.terminal().read(cx).title().into()) } diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs index 114f3eb88ef3b31b96cc4a7a1241d05c16c84668..80e27666f581c000e169cef5cd0b14e64b313cb3 100644 --- a/crates/welcome/src/welcome.rs +++ b/crates/welcome/src/welcome.rs @@ -198,7 +198,7 @@ impl WelcomePage { } impl Item for WelcomePage { - fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, _: &AppContext) -> Option> { Some("Welcome to Zed!".into()) } diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index 347a0022cc7bec890631c45d44c7d2f4b52fcbda..4cf47c77132bce0c3d385bd39b500c4430c7b30e 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -44,7 +44,7 @@ pub trait Item: View { fn navigate(&mut self, _: Box, _: &mut ViewContext) -> bool { false } - fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, _: &AppContext) -> Option> { None } fn tab_description<'a>(&'a self, _: usize, _: &'a AppContext) -> Option> { @@ -165,7 +165,7 @@ pub trait ItemHandle: 'static + fmt::Debug { cx: &mut AppContext, handler: Box, ) -> gpui::Subscription; - fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option>; + fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option>; fn tab_description<'a>(&self, detail: usize, cx: &'a AppContext) -> Option>; fn tab_content(&self, detail: Option, style: &theme::Tab, cx: &AppContext) -> ElementBox; @@ -252,7 +252,7 @@ impl ItemHandle for ViewHandle { }) } - fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option> { + fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option> { self.read(cx).tab_tooltip_text(cx) } diff --git a/crates/workspace/src/shared_screen.rs b/crates/workspace/src/shared_screen.rs index a1dcb89e44f939f99f3c81090746a4284baaf4da..a397c3a719fdd12b8b69c7612851a34290d34661 100644 --- a/crates/workspace/src/shared_screen.rs +++ b/crates/workspace/src/shared_screen.rs @@ -95,7 +95,7 @@ impl View for SharedScreen { } impl Item for SharedScreen { - fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option> { + fn tab_tooltip_text(&self, _: &AppContext) -> Option> { Some(format!("{}'s screen", self.user.github_login).into()) } fn deactivated(&mut self, cx: &mut ViewContext) {