mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 15:14:27 +00:00
feat(Text): Add a From<Cow<str>> impl for Text
This commit is contained in:
parent
975c4165d0
commit
703e41cd49
1 changed files with 6 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue