Skip to content

Commit

Permalink
Implement From<&str>
Browse files Browse the repository at this point in the history
  • Loading branch information
jD91mZM2 committed Aug 17, 2018
1 parent 9df039f commit 949116d
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 949116d

Please sign in to comment.