diff options
| author | 2021-10-31 17:42:43 +0700 | |
|---|---|---|
| committer | 2021-10-31 17:42:43 +0700 | |
| commit | 0c76e0307ff7d4450c354812f8a25047f24948b4 (patch) | |
| tree | c4ab989d99c65e2099a39d1e2f7a29db4816443b /style | |
| parent | eed19dcf81334d0849744f1918ba880d5a7acc1c (diff) | |
| download | iced-0c76e0307ff7d4450c354812f8a25047f24948b4.tar.gz iced-0c76e0307ff7d4450c354812f8a25047f24948b4.tar.bz2 iced-0c76e0307ff7d4450c354812f8a25047f24948b4.zip  | |
Reintroduce `Box` for `style_sheet` in `Slider`
Diffstat (limited to '')
| -rw-r--r-- | style/src/slider.rs | 13 | 
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/slider.rs b/style/src/slider.rs index c6791c3d..918e7753 100644 --- a/style/src/slider.rs +++ b/style/src/slider.rs @@ -79,8 +79,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)      }  }  | 
