Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn foo(y: i32) {
- println!("Foo {}", y);
- }
- fn main() {
- let y: i32 = 1;
- let mut maybe_x: Option<i32> = None;
- if true {
- maybe_x = Some(2);
- }
- match maybe_x {
- None => foo(y),
- Some(x) => {
- if x != y {
- foo(y)
- }
- },
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement