Option
-
Rust has a built in generic enum called
Option
that allows us to represent nullable values without using null -
This enum is so common, instances of the enum can be created anywhere with the enum variants
Some
andNone
#![allow(unused)] fn main() { enum Option<T> { None, Some(T), } }