lass='ident'>x</span>);
}</pre>

<!-- Neither of these options is particularly appealing. We can use `if let` to -->

<!-- do the same thing in a nicer way: -->

<p>上述のコードのどちらもまだ理想的ではありません。 <code>if let</code> を用いてより良い方法で記述できます:</p>

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