Skip to content

Commit

Permalink
rid-template: adding add msg to rust
Browse files Browse the repository at this point in the history
  • Loading branch information
thlorenz committed May 10, 2021
1 parent ab38f65 commit cbcffe4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rid-template-flutter/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl Model {
fn update(&mut self, msg: Msg) {
match msg {
Msg::Inc => self.count += 1,
Msg::Add(n) => self.count += n,
}
}
}
Expand All @@ -22,4 +23,5 @@ impl Model {
#[derive(Debug)]
pub enum Msg {
Inc,
Add(u32),
}

0 comments on commit cbcffe4

Please sign in to comment.