slice-patterns.mdcommit 024aa9a345e92aa1926517c4d9b16bd83e74c10d如果你想在一个切片或数组上匹配,你可以通过slice_patterns功能使用&:#![feature(slice_patterns)]fn main() { let v = vec!["match_this", "1"]; match &v[..] { ["match_this", second] => println!("The second element is {}", second), _ =>