feat(Text): Add a From<Cow<str>> impl for Text

This commit is contained in:
Andrew Chin 2021-04-17 13:25:12 -04:00 committed by Florian Dehau
parent 975c4165d0
commit 703e41cd49

View file

@ -398,6 +398,12 @@ impl<'a> From<&'a str> for Text<'a> {
}
}
impl<'a> From<Cow<'a, str>> for Text<'a> {
fn from(s: Cow<'a, str>) -> Text<'a> {
Text::raw(s)
}
}
impl<'a> From<Span<'a>> for Text<'a> {
fn from(span: Span<'a>) -> Text<'a> {
Text {