Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (12 sloc) 314 Bytes
enum Optional<T> {
CNone,
CSome(T)
}
fn main() {
let int_optional_none:Optional<i32> = Optional::CNone;
let int_optional_some:Optional<i32> = Optional::CSome(10);
match int_optional_some {
Optional::CSome(value) => println!("value is {}", value),
Optional::CNone => println!("none value")
}
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.