-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
There's a lot to digest in this snippet …
match event {
Event::KeyDown {
keycode: Some(Keycode::Escape),
..
} => break 'game,
_ => continue 'game,
}With barely any prior introduction to the features shown it ends up hitting newcomers to Rust in the face like a wrecking ball.
It got them all:
enumwith associated values.- multi-level destructuring
Some(…)(which hides anOption::Someby eliding theOption::)..'game(I can count the number of times I've seen a label like this be used in the wild on one hand)breakvs.continue_=>
To make things worse: with the exception of "break vs. continue" none of these things can easily be searched for either.
The continue 'game should probably also be just continue, as else one could end up dropping events, that should be handled.
--
Over all it might make sense to add links to corresponding references in Rust by Example when introducing new concepts and syntax.
Metadata
Metadata
Assignees
Labels
No labels