31 lines · 815 B · Rust
RawDownload
//! Minimal stand-in for the real `gpui_shared_string` crate. The lint keys//! off the crate name and the type name `SharedString`, so we only need to//! reproduce those. #[derive(Clone)]pub struct SharedString(String); impl SharedString {    pub const fn new_static(s: &'static str) -> Self {        // The real implementation stores the `'static` pointer; we just wrap        // an empty String at compile time to keep this `const`.        let _ = s;        SharedString(String::new())    }     pub fn new(s: impl AsRef<str>) -> Self {        SharedString(s.as_ref().to_owned())    }} impl From<&str> for SharedString {    fn from(s: &str) -> Self {        SharedString(s.to_owned())    }} impl From<String> for SharedString {    fn from(s: String) -> Self {        SharedString(s)    }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t