fn sum(x: &[u8]) -> usize {
let mut tot = 0;
for i in 0..10 {
tot += x[i] as usize
}
return tot;
}
fn func(y: &[u8]) -> usize {
let tot = sum(&&&&y); /* Look here! */
return tot;
}
fn main() {
let w: [u8; 10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let tot = func(&w);
println!("{}", tot);
}
该程序的工作方式与所指示的&的数量无关。什么是正确的,语法是什么?