On 02/23/2016 09:58 AM, Xinok wrote:

Option<T> is an enum type in Rust (i.e. algebraic data type). The Rust
compiler forces you to check all possible cases so you can't use it
improperly. So you would have to use something like pattern matching or
"if let" to check the state.

https://doc.rust-lang.org/book/match.html#matching-on-enums

Probably we can do the same in a library: never allow the value out of an Option, but provide a visitor with two aliases (ham/spam). There was a related PR in Phobos, wasn't there? -- Andrei

Reply via email to