Is the Rust compiler smart enough to know to optimise optional parameters away?
fn foo(value: i32) {
...
}
fn foo_optional(optional: Option<i32>) {
foo(optional.unwrap_or(5));
}
fn main() {
foo_optional(None);
foo(5);
}
Essentially, is foo(5) the exact same thing as foo_optional(None) where optional is known to be None at compile-time?
