mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
gpui: Use SharedString::new_static within From impls for ElementId where possible (#56139)
Horror of a PR title but could not think of anything better here. Release Notes: - N/A --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
parent
6766514599
commit
e1a46f9256
1 changed files with 5 additions and 5 deletions
|
|
@ -5764,7 +5764,7 @@ impl From<Arc<std::path::Path>> for ElementId {
|
|||
|
||||
impl From<&'static str> for ElementId {
|
||||
fn from(name: &'static str) -> Self {
|
||||
ElementId::Name(name.into())
|
||||
ElementId::Name(SharedString::new_static(name))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5776,13 +5776,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5794,7 +5794,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5806,7 +5806,7 @@ impl From<Uuid> 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), u64::from(id))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue