title: How solve "cannot index a value of type `usize`" error?
body: <p>I am trying to measure the speed of <code>Vec</code>'s <code>[]</code> indexing vs. <code>.get(index)</code>  using the following code:</p>
  
  <pre><code>extern crate time;
  
  fn main() {
      let v = vec![1; 1_000_000];
      let before_rec1 = time::precise_time_ns();
  
      for (i, v) in (0..v.len()).enumerate() {
          v[i]
      }
      let after_rec1 = time::precise_time_ns();
      println!("Total time: {}", after_rec1 - before_rec1);
  
  
      let before_rec2 = time::precise_time_ns();
  
      for (i, v) in (0..v.len()).enumerate() {
          v.get(i)
      }
      let after_rec2 = time::precise_time_ns();
      println!("Total time: {}", after_rec2 - before_rec2);
  }
  </code></pre>
  
  <p>but this returns the following errors:</p>
  
  <pre class="lang-none prettyprint-override"><code>error: cannot index a value of type `usize`
   --&gt; src/main.rs:8:9
    |
  8 |         v[i]
    |         ^^^^
  
  error: no method named `get` found for type `usize` in the current scope
    --&gt; src/main.rs:17:11
     |
  17 |         v.get(i)
     |           ^^^
  </code></pre>
  
  <p>I'm confused why this doesn't work, since <code>enumerate</code> should give me an index which, by its very name, I should be able to use to index the vector.</p>
  
  <ol>
  <li>Why is this error being thrown?</li>
  <li>I know I can/should use iteration rather than C-style way of indexing, but for learning's sake what do I use to iterate over the index values like I'm trying to do here?</li>
  </ol>