diff --git a/crates/ui2/src/elements/label.rs b/crates/ui2/src/elements/label.rs index edcc76665a..accd9e2be5 100644 --- a/crates/ui2/src/elements/label.rs +++ b/crates/ui2/src/elements/label.rs @@ -48,7 +48,7 @@ pub enum LabelSize { #[derive(Element, Clone)] pub struct Label { state_type: PhantomData, - label: String, + label: SharedString, color: LabelColor, size: LabelSize, highlight_indices: Vec, @@ -56,10 +56,7 @@ pub struct Label { } impl Label { - pub fn new(label: L) -> Self - where - L: Into, - { + pub fn new(label: impl Into) -> Self { Self { state_type: PhantomData, label: label.into(), diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rs index 4fddabe3a5..44ca262470 100644 --- a/crates/ui2/src/prelude.rs +++ b/crates/ui2/src/prelude.rs @@ -1,6 +1,6 @@ pub use gpui3::{ - div, Click, Element, Hover, IntoAnyElement, ParentElement, ScrollState, Styled, ViewContext, - WindowContext, + div, Click, Element, Hover, IntoAnyElement, ParentElement, ScrollState, SharedString, Styled, + ViewContext, WindowContext, }; pub use crate::{theme, ButtonVariant, ElementExt, Theme};