let with_vec = Some(vec![1]);
with_vec.unwrap_or(vec![]);
- // FIXME #944: ~|SUGGESTION with_vec.unwrap_or_else(|| vec![]);
-
let without_default = Some(Foo);
without_default.unwrap_or(Foo::new());
.or(Some(Bar(b, Duration::from_secs(2))));
}
-
// Issue 4514 - early return
fn f() -> Option<()> {
let a = Some(1);
Some(())
}
-
fn main() {}