2017-08-29 02:55:40 -05:00
|
|
|
fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] {
|
|
|
|
[a, b, b, a]
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let out = bar("baz", "foo");
|
2019-07-29 03:21:59 -05:00
|
|
|
let [a, xs @ .., d] = out;
|
2017-08-29 02:55:40 -05:00
|
|
|
assert_eq!(a, "baz");
|
|
|
|
assert_eq!(xs, ["foo", "foo"]);
|
|
|
|
assert_eq!(d, "baz");
|
|
|
|
}
|