From 304eddbbe4a83482fb3b9e4ab37065a50485e5da Mon Sep 17 00:00:00 2001 From: Joseph Lyons Date: Tue, 18 Apr 2023 14:15:56 -0400 Subject: [PATCH] Remove unnecessary lifetimes from `tab_description` --- crates/editor/src/items.rs | 2 +- crates/workspace/src/item.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 64147effff..c5e0e8993e 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -531,7 +531,7 @@ impl Item for Editor { Some(file_path.into()) } - fn tab_description<'a>(&'a self, detail: usize, cx: &'a AppContext) -> Option> { + fn tab_description<'a>(&'a self, detail: usize, cx: &'a AppContext) -> Option> { match path_for_buffer(&self.buffer, detail, true, cx)? { Cow::Borrowed(path) => Some(path.to_string_lossy()), Cow::Owned(path) => Some(path.to_string_lossy().to_string().into()), diff --git a/crates/workspace/src/item.rs b/crates/workspace/src/item.rs index 4cf47c7713..6c41507478 100644 --- a/crates/workspace/src/item.rs +++ b/crates/workspace/src/item.rs @@ -47,7 +47,7 @@ pub trait Item: View { fn tab_tooltip_text(&self, _: &AppContext) -> Option> { None } - fn tab_description<'a>(&'a self, _: usize, _: &'a AppContext) -> Option> { + fn tab_description<'a>(&'a self, _: usize, _: &'a AppContext) -> Option> { None } fn tab_content(&self, detail: Option, style: &theme::Tab, cx: &AppContext) @@ -165,8 +165,8 @@ pub trait ItemHandle: 'static + fmt::Debug { cx: &mut AppContext, handler: Box, ) -> gpui::Subscription; - fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option>; - fn tab_description<'a>(&self, detail: usize, cx: &'a AppContext) -> Option>; + fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option>; + fn tab_description<'a>(&'a self, detail: usize, cx: &'a AppContext) -> Option>; fn tab_content(&self, detail: Option, style: &theme::Tab, cx: &AppContext) -> ElementBox; fn project_path(&self, cx: &AppContext) -> Option; @@ -252,11 +252,11 @@ impl ItemHandle for ViewHandle { }) } - fn tab_tooltip_text<'a>(&'a self, cx: &'a AppContext) -> Option> { + fn tab_tooltip_text<'a>(&self, cx: &'a AppContext) -> Option> { self.read(cx).tab_tooltip_text(cx) } - fn tab_description<'a>(&self, detail: usize, cx: &'a AppContext) -> Option> { + fn tab_description<'a>(&'a self, detail: usize, cx: &'a AppContext) -> Option> { self.read(cx).tab_description(detail, cx) } @@ -913,7 +913,7 @@ pub(crate) mod test { } impl Item for TestItem { - fn tab_description<'a>(&'a self, detail: usize, _: &'a AppContext) -> Option> { + fn tab_description(&self, detail: usize, _: &AppContext) -> Option> { self.tab_descriptions.as_ref().and_then(|descriptions| { let description = *descriptions.get(detail).or_else(|| descriptions.last())?; Some(description.into())