Skip to content

Commit

Permalink
Merge pull request rust-lang#1 from jD91mZM2/master
Browse files Browse the repository at this point in the history
Implement From<&str>
  • Loading branch information
matklad authored Aug 17, 2018
2 parents 9df039f + 949116d commit e367ab7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ impl fmt::Display for SmolStr {
}
}

impl<'a> From<&'a str> for SmolStr {
fn from(text: &'a str) -> Self {
Self::new(text)
}
}

const INLINE_CAP: usize = 22;
const WS_TAG: u8 = (INLINE_CAP + 1) as u8;
const N_NEWLINES: usize = 32;
Expand Down

0 comments on commit e367ab7

Please sign in to comment.