mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Support converting Lowercase to Box<str>
This commit is contained in:
parent
e1359c3025
commit
0bff2c6674
2 changed files with 38 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue