Some(null) is not a valid result.
The whole point of the Option type is to let you know:
a) we got a result: Some(value)
b) there is no result: None
struct Foo; fn main() { let option_with_null: Option<*const Foo> = Some(std::ptr::null()); dbg!(option_with_null); dbg!(option_with_null.is_none()); }
[src/main.rs:6] option_with_null = Some( 0x0000000000000000, ) [src/main.rs:7] option_with_null.is_none() = false
> Some(null) is not a valid result.
It is a valid result. Null pointer and Option::None are still different things, is all.
Some(null) is not a valid result.
The whole point of the Option type is to let you know:
a) we got a result: Some(value)
b) there is no result: None