Skip to content

Commit

Permalink
harmonize messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tronta committed Oct 18, 2024
1 parent 7dc5cb8 commit 03d92fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/simple_manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct AppModel {

#[derive(Debug)]
// ANCHOR: msg
enum AppInput {
enum AppMsg {
Increment,
Decrement,
}
Expand All @@ -30,7 +30,7 @@ impl SimpleComponent for AppModel {

// ANCHOR: constants
/// The type of the messages that this component can receive.
type Input = AppInput;
type Input = AppMsg;
/// The type of the messages that this component can send.
type Output = ();
/// The type of data with which this component will be initialized.
Expand Down Expand Up @@ -102,10 +102,10 @@ impl SimpleComponent for AppModel {
// ANCHOR: update_function
fn update(&mut self, message: Self::Input, _sender: ComponentSender<Self>) {
match message {
AppInput::Increment => {
AppMsg::Increment => {
self.counter = self.counter.wrapping_add(1);
}
AppInput::Decrement => {
AppMsg::Decrement => {
self.counter = self.counter.wrapping_sub(1);
}
}
Expand Down

0 comments on commit 03d92fd

Please sign in to comment.