Skip to content

Commit

Permalink
Add From<&String> for EcoString impl
Browse files Browse the repository at this point in the history
  • Loading branch information
IanManske committed Nov 6, 2023
1 parent e9bcef2 commit 89a0523
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@ impl From<String> for EcoString {
}
}

impl From<&String> for EcoString {
#[inline]
fn from(s: &String) -> Self {
Self::from_str(s.as_str())
}
}

impl From<Cow<'_, str>> for EcoString {
#[inline]
fn from(s: Cow<str>) -> Self {
Expand Down

0 comments on commit 89a0523

Please sign in to comment.