2 ms·
> Rust's Option can't be simply dereferenced causing UB, so `val.is_some() & val.kaboom()` doesn't compile. I guess the equivalent of `operator->` would be `un
by jhasse 5y ago
> Rust's Option can't be simply dereferenced causing UB, so `val.is_some() & val.kaboom()` doesn't compile.
I guess the equivalent of `operator->` would be `unwrap()`. It isn't UB, so this bug couldn't happen in Rust indeed.
> Rust doesn't have implicit conversion between booleans and integers, so a problematic `true & 2` does not compile either.
That isn't what's happening here as both `key_data_.has_value()` and `!key_data_->label().empty()` return bool.