Refactor to use SharedString in more places (#23813)
Splitting this off from https://github.com/zed-industries/zed/pull/23808, per @maxdeviant's suggestion! Release Notes: - N/A --------- Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan
parent
92a1cb893f
commit
33d1145c3f
@@ -15,6 +15,11 @@ impl SharedString {
|
||||
pub const fn new_static(str: &'static str) -> Self {
|
||||
Self(ArcCow::Borrowed(str))
|
||||
}
|
||||
|
||||
/// Creates a [`SharedString`] from anything that can become an Arc<str>
|
||||
pub fn new(str: impl Into<Arc<str>>) -> Self {
|
||||
SharedString(ArcCow::Owned(str.into()))
|
||||
}
|
||||
}
|
||||
|
||||
impl JsonSchema for SharedString {
|
||||
|
||||
Reference in New Issue
Block a user