title: Is there a way to get every n * i element of a vector?
body: <p>Is there any clever way to get every <code>n * i</code> element of a vector? I have this vector:</p>
  <pre class="lang-rust prettyprint-override"><code>let example = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
  </code></pre>
  <p>I want every third value of this vector, so the output will be:</p>
  <pre class="lang-rust prettyprint-override"><code>let result = vec![3, 6, 9];
  </code></pre>
  <p>I know that I can achieve this with a for loop:</p>
  <pre class="lang-rust prettyprint-override"><code>let mut result: Vec&lt;i32&gt; = vec![];
  let offset = 3;
  for (index, value) in example.iter().enumerate() {
      if (index + 1) % offset == 0 {
          result.push(value.clone());
      }
  }
  </code></pre>