From f9a466d12d31f82928986f64408f6fb4fc4132ee Mon Sep 17 00:00:00 2001 From: MrSubidubi Date: Fri, 8 May 2026 09:33:16 +0200 Subject: [PATCH 1/2] gpui: Use `SharedString::new_static` within `From` impls for `ElementId` where possible --- crates/gpui/src/window.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index dc387c67f39817..0787e4a85b8e6f 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -5759,7 +5759,7 @@ impl From> for ElementId { impl From<&'static str> for ElementId { fn from(name: &'static str) -> Self { - ElementId::Name(name.into()) + ElementId::Name(SharedString::new_static(name)) } } @@ -5771,13 +5771,13 @@ impl<'a> From<&'a FocusHandle> for ElementId { impl From<(&'static str, EntityId)> for ElementId { fn from((name, id): (&'static str, EntityId)) -> Self { - ElementId::NamedInteger(name.into(), id.as_u64()) + ElementId::NamedInteger(SharedString::new_static(name), id.as_u64()) } } impl From<(&'static str, usize)> for ElementId { fn from((name, id): (&'static str, usize)) -> Self { - ElementId::NamedInteger(name.into(), id as u64) + ElementId::NamedInteger(SharedString::new_static(name), id as u64) } } @@ -5789,7 +5789,7 @@ impl From<(SharedString, usize)> for ElementId { impl From<(&'static str, u64)> for ElementId { fn from((name, id): (&'static str, u64)) -> Self { - ElementId::NamedInteger(name.into(), id) + ElementId::NamedInteger(SharedString::new_static(name), id) } } @@ -5801,7 +5801,7 @@ impl From for ElementId { impl From<(&'static str, u32)> for ElementId { fn from((name, id): (&'static str, u32)) -> Self { - ElementId::NamedInteger(name.into(), id.into()) + ElementId::NamedInteger(SharedString::new_static(name), id as u64) } } From e8f0b46cd3a0c13e6abdd7feaa791703f7c3e9c9 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Fri, 8 May 2026 09:53:56 +0200 Subject: [PATCH 2/2] Update crates/gpui/src/window.rs Co-authored-by: Kirill Bulatov --- crates/gpui/src/window.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 0787e4a85b8e6f..05fde3e9bde290 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -5801,7 +5801,7 @@ impl From for ElementId { impl From<(&'static str, u32)> for ElementId { fn from((name, id): (&'static str, u32)) -> Self { - ElementId::NamedInteger(SharedString::new_static(name), id as u64) + ElementId::NamedInteger(SharedString::new_static(name), u64::from(id)) } }