Remove unnecessary lifetimes from `tab_tooltip_text`

Joseph Lyons created

Change summary

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

Detailed changes

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<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, _: &AppContext) -> Option<Cow<str>> {
         Some("Project Diagnostics".into())
     }
 

crates/editor/src/items.rs 🔗

@@ -514,7 +514,7 @@ impl Item for Editor {
         }
     }
 
-    fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, cx: &AppContext) -> Option<Cow<str>> {
         let file_path = self
             .buffer()
             .read(cx)

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<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, _: &AppContext) -> Option<Cow<str>> {
         Some("Send Feedback".into())
     }
 

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<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, cx: &AppContext) -> Option<Cow<str>> {
         Some(self.query_editor.read(cx).text(cx).into())
     }
 

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<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, cx: &AppContext) -> Option<Cow<str>> {
         Some(self.terminal().read(cx).title().into())
     }
 

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<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, _: &AppContext) -> Option<Cow<str>> {
         Some("Welcome to Zed!".into())
     }
 

crates/workspace/src/item.rs 🔗

@@ -44,7 +44,7 @@ pub trait Item: View {
     fn navigate(&mut self, _: Box<dyn Any>, _: &mut ViewContext<Self>) -> bool {
         false
     }
-    fn tab_tooltip_text<'a>(&'a self, _: &'a AppContext) -> Option<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, _: &AppContext) -> Option<Cow<str>> {
         None
     }
     fn tab_description<'a>(&'a self, _: usize, _: &'a AppContext) -> Option<Cow<'a, str>> {
@@ -165,7 +165,7 @@ pub trait ItemHandle: 'static + fmt::Debug {
         cx: &mut AppContext,
         handler: Box<dyn Fn(ItemEvent, &mut AppContext)>,
     ) -> gpui::Subscription;
-    fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option<Cow<'a, str>>;
+    fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option<Cow<str>>;
     fn tab_description<'a>(&self, detail: usize, cx: &'a AppContext) -> Option<Cow<'a, str>>;
     fn tab_content(&self, detail: Option<usize>, style: &theme::Tab, cx: &AppContext)
         -> ElementBox;
@@ -252,7 +252,7 @@ impl<T: Item> ItemHandle for ViewHandle<T> {
         })
     }
 
-    fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option<Cow<'a, str>> {
+    fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option<Cow<str>> {
         self.read(cx).tab_tooltip_text(cx)
     }
 

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<Cow<'a, str>> {
+    fn tab_tooltip_text(&self, _: &AppContext) -> Option<Cow<str>> {
         Some(format!("{}'s screen", self.user.github_login).into())
     }
     fn deactivated(&mut self, cx: &mut ViewContext<Self>) {