gpui: Implement From<String> for ElementId (#44447)
Release Notes:
- N/A
## Before
```rs
div()
.id(SharedString::from(format!("process-entry-{ix}-command")))
```
## After
```rs
div()
.id(format!("process-entry-{ix}-command"))
```
This commit is contained in:
@@ -5084,6 +5084,18 @@ impl From<SharedString> for ElementId {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for ElementId {
|
||||
fn from(name: String) -> Self {
|
||||
ElementId::Name(name.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Arc<str>> for ElementId {
|
||||
fn from(name: Arc<str>) -> Self {
|
||||
ElementId::Name(name.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Arc<std::path::Path>> for ElementId {
|
||||
fn from(path: Arc<std::path::Path>) -> Self {
|
||||
ElementId::Path(path)
|
||||
|
||||
Reference in New Issue
Block a user