class='number'>3</span>);</pre>

<p>Popping values works in much the same way:</p>
<span class='rusttest'>fn main() {
    let mut v = vec![1, 2];
    
    let two = v.pop();
    
}</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='number'>1</span>, <span class='number'>2</span>];

<span class='kw'>let</span> <span class='ident'>