Use associated type for Message in a canvas::Program

This commit is contained in:
Héctor Ramón Jiménez 2022-03-09 18:27:22 +07:00
parent 12c1a3f829
commit c52fd089f1
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
7 changed files with 37 additions and 24 deletions

View file

@ -76,7 +76,9 @@ impl Application for Clock {
}
}
impl canvas::Program<Message> for Clock {
impl canvas::Program for Clock {
type Message = Message;
fn draw(&self, bounds: Rectangle, _cursor: Cursor) -> Vec<Geometry> {
let clock = self.clock.draw(bounds.size(), |frame| {
let center = frame.center();