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

@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- `Button::background` takes an `Into<Background>` now instead of a `Background`.
### Fixed
- Render not being scheduled after `Command` futures finishing.

View file

@ -81,8 +81,8 @@ impl<'a, Message> Button<'a, Message> {
///
/// [`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
}