Make Button::background generic

This commit is contained in:
Héctor Ramón Jiménez 2019-12-05 01:57:35 +01:00
parent f87ddf1056
commit e92ea48e88
7 changed files with 21 additions and 20 deletions

View file

@ -89,8 +89,8 @@ impl<'a, Message, Renderer> Button<'a, Message, Renderer> {
///
/// [`Button`]: struct.Button.html
/// [`Background`]: ../../struct.Background.html
pub fn background(mut self, background: Background) -> Self {
self.background = Some(background);
pub fn background<T: Into<Background>>(mut self, background: T) -> Self {
self.background = Some(background.into());
self
}