绑定

    1. fn some_number() -> Option<u32> {
    2. Some(42)
    3. fn main() {
    4. match some_number() {
    5. // Got `Some` variant, match if its value, bound to `n`,
    6. // is equal to 42.
    7. Some(n) => println!("Not interesting... {}", n),
    8. // Match anything else (`None` variant).
    9. _ => (),
    10. }