Rust pattern matching over a vector. You need slice patterns: fn vec_alt<A>(vals: Vec<A>) -> &'static str { match vals[..] { [] => "empty", _ => "otherwise" ...
確定! 回上一頁