main() {
    let option = Some(5);
fn foo(x: i32) { }
fn bar() { }
if let Some(x) = option {
    foo(x);
} else {
    bar();
}
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>if</span> <span class='kw'>let</span> <span class='prelude-val'>Some</span>(<span class='ident'>x</span>) <span class='op'>=</span> <span class='ident'>option</span> {
    <span class='ident'>foo</span>(<span class='ident'>x</span>);
} <span class='kw'>else</span> {
    <span class='ident'>bar</span>();
}</pre>

<h2 i