mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-25 05:42:18 +08:00
12 lines
241 B
Rust
12 lines
241 B
Rust
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
let mut s = String::from("hello");
|
||
|
|
||
|
let r1 = &s; // no problem
|
||
|
let r2 = &s; // no problem
|
||
|
let r3 = &mut s; // BIG PROBLEM
|
||
|
|
||
|
println!("{}, {}, and {}", r1, r2, r3);
|
||
|
// ANCHOR_END: here
|
||
|
}
|