pan> <span class='op'>=&gt;</span> {},
}</pre>

<!-- We don’t have to use `match` here, for example, we could use `if`: -->

<p>このような場合 <code>match</code> を用いなくても良く、 <code>if</code> を使って以下のように書けます:</p>

<span class='rusttest'>fn main() {
    let option = Some(5);
fn foo(x: i32) { }
if option.is_some() {
    let x = option.unwrap();
    foo(x);
}
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>if</span> <span class='ident'>opti