2 ms·
"Rust doesn't have null, but it has Option<T>, which is often syntactic sugar for null." In a sense, yes. But you have to do something positive before you can
by mcguire 11y ago
"Rust doesn't have null, but it has Option<T>, which is often syntactic sugar for null."
In a sense, yes. But you have to do something positive before you can pretend that nothing is something. And the call to unwrap can be annotated with an argument as for why it can never fail, or why it's unimportant if it panics, or even be outlawed by a style guide.
"It's not that null is bad in itself. It's that having variables which might be null need to be distinguished from ones which can't be null."
Amen, brother.