two</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>pop</span>();</pre>

<p>Vectors also support indexing (through the <code>Index</code> and <code>IndexMut</code> traits):</p>
<span class='rusttest'>fn main() {
    let mut v = vec![1, 2, 3];
    let three = v[2];
    v[1] = v[1] + 5;
    
}</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</