mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2024-11-14 21:11:31 +08:00
12 lines
237 B
Rust
12 lines
237 B
Rust
fn main() {
|
|
// ANCHOR: here
|
|
let mut s = String::from("hello");
|
|
|
|
let r1 = &s; // 没问题
|
|
let r2 = &s; // 没问题
|
|
let r3 = &mut s; // 大问题
|
|
|
|
println!("{}, {}, and {}", r1, r2, r3);
|
|
// ANCHOR_END: here
|
|
}
|