title: How to write a nested array where the inner arrays are different lengths?
body: <p>I have a function that generates anagrams and I want to test it so I have the following:</p>
  
  <pre class="lang-rust prettyprint-override"><code>pub fn group_anagrams(strs: Vec&lt;String&gt;) -&gt; Vec&lt;Vec&lt;String&gt;&gt; {
      unimplemented!()
  }
  
  fn main() {
      let words = [
          "eat".to_string(),
          "tea".to_string(),
          "tan".to_string(),
          "ate".to_string(),
          "nat".to_string(),
          "bat".to_string(),
      ]
      .to_vec();
      let answer = [["ate", "eat", "tea"], ["nat", "tan"], ["bat"]];
      let solution = group_anagrams(words);
      assert_eq!(answer, solution);
  }
  </code></pre>
  
  <p>I can't figure out how to write this in a way that will compile:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0308]: mismatched types
    --&gt; src/main.rs:15:42
     |
  15 |     let answer = [["ate", "eat", "tea"], ["nat", "tan"], ["bat"]];
     |                                          ^^^^^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
     |
     = note: expected type `[&amp;str; 3]`
               found array `[&amp;str; 2]`
  </code></pre>
  
  <p>(<a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=5c30653700067b68d51ade8333cbaacd" rel="nofollow noreferrer">Playground</a>)</p>