title: Rust how to make function accept list of size n?
body: <pre class="lang-rust prettyprint-override"><code>fn function_name(the_list: ?) {
      // do something
      println!(&quot;{}&quot;,the_list);
  }
  
  fn main() {
      let data = [5,20,18,30,9,7,12,40]; // where data size is n
      let result = function_name(&amp;data);
  }
  </code></pre>
  <p>I have a very simple function here which I want to pass a list of size n into. I have looked through the docs and only found solutions for lists whose size is known which is not what I want.</p>
  <p>How do I approach this problem?</p>