Skip to content

Commit 1fd0138

Browse files
committed
Added doc
1 parent 06a026d commit 1fd0138

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rust/app/src/hello.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ fn ui_builder() -> impl Widget<u32> { // `u32` is the application state
3535
LocalizedString::new("hello-counter")
3636
.with_arg(
3737
"count",
38-
// Closure that will be run to fetch the counter value
39-
| data: &u32, _env |
40-
(*data).into() // We return the counter value in the application state
38+
// Closure that will fetch the counter value...
39+
| data: &u32, _env | // Closure will receive the application state and environment
40+
(*data).into() // We return the counter value in the application state
4141
);
4242
// Create a label widget to display the text
4343
let label = Label::new(text);
4444
// Create a button widget to increment the counter
4545
let button = Button::new(
4646
"increment", // Text to be shown
47-
// Closure that will be run when button is tapped
48-
| _ctx, data, _env |
49-
*data += 1 // We increment the counter
47+
// Closure that will be called when button is tapped...
48+
| _ctx, data, _env | // Closure will receive the context, application state and environment
49+
*data += 1 // We increment the counter
5050
);
5151

5252
// Create a column for the UI

0 commit comments

Comments
 (0)