title: Return last n elements of vector in Rust without mutating the vector
body: <p>I  am struggling to find a way to take two values from the end of a vector, sum those values, and push the sum to the vector.</p>
  
  <p>I have found that <code>pop</code>, <code>truncate</code>, and <code>drain</code> do not work because they remove the values from the original vector.</p>
  
  <pre><code>fn main() {
      println!("Which Fibonacci number would you like to find?");
  
      let mut fib_num = String::new();
  
      io::stdin().read_line(&amp;mut fib_num)
          .expect("Failed to read line");
  
      let fib_num: u32 = fib_num.trim().parse()
          .expect("Please enter a number");
  
      let mut stored_nums: Vec&lt;u32&gt; = vec![0, 1];
  
      while fib_num &gt; stored_nums.len() as u32 {
          let mut limit = stored_nums.len();
          let mut new_num1 = stored_nums.pop().unwrap();
          let mut new_num2 = stored_nums.pop().unwrap_or(0);
          stored_nums.push(new_num1 + new_num2);
      }
  }
  </code></pre>