From e90411efa23d8c27433ddc7f6dcacc14bd0f6cf5 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 28 Mar 2025 15:19:20 -0400 Subject: [PATCH] gpui: Remove unneeded anonymous lifetime from `Render::render` (#27684) This PR removes an unneeded anonymous lifetime from the `cx` parameter to `Render::render`. This makes it so the anonymous lifetime doesn't show up when implementing the `Render` trait via a code action: #### Before ```rs struct Foo; impl Render for Foo { fn render(&mut self, window: &mut Window, cx: &mut Context<'_, Self>) -> impl IntoElement { todo!() } } ``` #### After ```rs struct Foo; impl Render for Foo { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { todo!() } } ``` Release Notes: - N/A --- crates/gpui/src/element.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui/src/element.rs b/crates/gpui/src/element.rs index c4e70d78852a46355cf4cca981af8a02f5deb83d..6af0474ad50ac8a84f961202b9c70fb9906ec90b 100644 --- a/crates/gpui/src/element.rs +++ b/crates/gpui/src/element.rs @@ -118,7 +118,7 @@ impl FluentBuilder for T {} /// other entities. Views are `Entity`'s which `impl Render` and drawn to the screen. pub trait Render: 'static + Sized { /// Render this view into an element tree. - fn render(&mut self, window: &mut Window, cx: &mut Context<'_, Self>) -> impl IntoElement; + fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement; } impl Render for Empty {