title: Passing a Vec into a function by reference
body: <p>I'm having some trouble passing a <code>Vec&lt;u64&gt;</code> into a function without moving it. I have a function <code>find_factors(mut n: u64, mut fctrs: Vec&lt;u64&gt;)</code> and I am currently calling from main like so:</p>
  
  <pre><code>fn main() {
      let mut primeFactors: Vec&lt;u64&gt; = Vec::new();
      find_factors(1134 as u64, primeFactors);
  }
  </code></pre>
  
  <p>I'm forced right now to loop through and print out my vector in the <code>find_factors</code> function because I'm not sure how to pass the <code>Vec&lt;u64&gt;</code> by reference instead of moving it. How could I accomplish this? Example of what I want to do:</p>
  
  <pre><code>fn main() {
      let mut primeFactors: Vec&lt;u64&gt; = Vec::new();
      find_factors(1134 as u64, primeFactors);
  
      //for ....
          //print vector in main!
  }
  </code></pre>