diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 64147effff086a2721ba5f7b2c99d537ce9942c9..c5e0e8993e439391f5042ae6bf3e66d682267087 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 4cf47c77132bce0c3d385bd39b500c4430c7b30e..6c41507478a5185a13c97984ed551aadb69ccdd7 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())