以下のように書けるでしょう:</p>

<span class='rusttest'>fn main() {
    let option = Some(5);
fn foo(x: i32) { }
match option {
    Some(x) =&gt; { foo(x) },
    None =&gt; {},
}
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>match</span> <span class='ident'>option</span> {
    <span class='prelude-val'>Some</span>(<span class='ident'>x</span>) <span class='op'>=&gt;</span> { <span class='ident'>foo</span>(<span class='ident'>x</span>) },
    <span class='prelude-val'>None</s