Support converting Lowercase to Box<str>

This commit is contained in:
Richard Feldman 2022-08-09 15:36:38 -04:00 committed by Ayaz Hafiz
parent e1359c3025
commit 0bff2c6674
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 38 additions and 0 deletions

View file

@ -193,6 +193,20 @@ impl Lowercase {
}
}
impl From<Lowercase> for String {
fn from(lowercase: Lowercase) -> Self {
lowercase.0.into()
}
}
impl From<Lowercase> for Box<str> {
fn from(lowercase: Lowercase) -> Self {
let string: String = lowercase.0.into();
string.into()
}
}
impl<'a> From<&'a str> for Lowercase {
fn from(string: &'a str) -> Self {
Self(string.into())