Rust 问题解惑

fn main() { let regions = [“southern_germany”, “chinese”, “english”]; // for regin in regions.iter() { // println!("{}", regin); // }

for region in regions.into_iter() {
    println!("{}", region);
}

for region in regions {
    println!("{}", region);
}


// let f = 13.24;
// let r: f64 = 13.14f64.round();
// println!("{}, {}", r, f);

}

https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html

let s = “hello” let s2 = &s; println!("{}", s2) // 会自动解引用

https://doc.rust-lang.org/std/primitive.array.html