Implement Into<Element> for &'static str in iced_virtual

This commit is contained in:
Héctor Ramón Jiménez 2022-02-10 23:16:21 +07:00
parent 5225e0e304
commit e03de01988
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 27 additions and 14 deletions

View file

@ -174,3 +174,12 @@ where
Element::new(self)
}
}
impl<Message, Renderer> Into<Element<Message, Renderer>> for &'static str
where
Renderer: text::Renderer + 'static,
{
fn into(self) -> Element<Message, Renderer> {
Text::new(self).into()
}
}