1 An array or slice pattern required more elements than were present in the
4 Example of erroneous code:
9 &[a, b, c, rest @ ..] => { // error: pattern requires at least 3
10 // elements but array has 2
11 println!("a={}, b={}, c={} rest={:?}", a, b, c, rest);
16 Ensure that the matched array has at least as many elements as the pattern
17 requires. You can match an arbitrary number of remaining elements with `..`:
20 let r = &[1, 2, 3, 4, 5];
22 &[a, b, c, rest @ ..] => { // ok!
23 // prints `a=1, b=2, c=3 rest=[4, 5]`
24 println!("a={}, b={}, c={} rest={:?}", a, b, c, rest);