Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Use `SharedString` for `Input`s

Marshall Bowers549e78d7b3ad
diff --git a/crates/ui2/src/elements/input.rs b/crates/ui2/src/elements/input.rs
index 0323de7032d..45edb1a73d7 100644
--- a/crates/ui2/src/elements/input.rs
+++ b/crates/ui2/src/elements/input.rs
@@ -13,17 +13,17 @@ pub enum InputVariant {
#[derive(Element)]
pub struct Input<S: 'static + Send + Sync> {
state_type: PhantomData<S>,
- placeholder: &'static str,
+ placeholder: SharedString,
value: String,
state: InteractionState,
variant: InputVariant,
}
impl<S: 'static + Send + Sync> Input<S> {
- pub fn new(placeholder: &'static str) -> Self {
+ pub fn new(placeholder: impl Into<SharedString>) -> Self {
Self {
state_type: PhantomData,
- placeholder,
+ placeholder: placeholder.into(),
value: "".to_string(),
state: InteractionState::default(),
variant: InputVariant::default(),