Skip to content

Commit

Permalink
Add From<&String> for EcoString impl (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanManske authored Nov 6, 2023
1 parent e9bcef2 commit ed469f8
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 ed469f8

Please sign in to comment.