4 ms·
Don't you do that in rust too? You'd be working with Option<T> instead of T.
by bpicolo 5y ago
Don't you do that in rust too? You'd be working with Option<T> instead of T.
- couchand 5y agoThe critical difference is that an Option<T> is not a T, but a nil pointer is still a pointer. The stylistic difference is that the Rust type is semantic: your optional values are Options. The Go type is silly: why does being a pointer (which is allowed to be nil) imply required?
- mcintyre1994 5y agoOption<Int> is a really good way to describe a field that if present is an int, but may not be present, though. Pointer isn't.