}</pre>

<!-- Into code like this: -->

<p><code>while let</code> を用いることで、以下のように書くことができます:</p>

<span class='rusttest'>fn main() {
    let mut v = vec![1, 3, 5, 7, 11];
while let Some(x) = v.pop() {
    println!(&quot;{}&quot;, x);
}
}</span><pre class='rust rust-example-rendered'>
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class