Reintroduce Box for style_sheet in TextInput

This commit is contained in:
Héctor Ramón Jiménez 2021-10-31 17:45:57 +07:00
parent 0c76e0307f
commit 0d3c9ef7bd
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 25 additions and 10 deletions

View file

@ -73,8 +73,17 @@ impl StyleSheet for Default {
}
}
impl std::default::Default for &'static dyn StyleSheet {
impl std::default::Default for Box<dyn StyleSheet> {
fn default() -> Self {
&Default
Box::new(Default)
}
}
impl<'a, T> From<T> for Box<dyn StyleSheet + 'a>
where
T: StyleSheet + 'a,
{
fn from(style_sheet: T) -> Self {
Box::new(style_sheet)
}
}