Hacker News new | ask | show | jobs
by beagle3 4067 days ago
What's the rust name/syntax for non-nil vars?
1 comments

    let foo = 5; // cannot be null
    let bar = Some(5); // technically also can't be null, but could be None
                       // instead of Some(val)
`foo` has the type `i32` here, and `bar` has the type `Option<i32>`.