PR3-Rust-SS26/D-ownership/example-code/03-borrowing/combination-references.rs

10 lines
148 B
Rust

fn main() {
let mut s = String::from("hello");
let r1 = &s;
let r2 = &s;
let r3 = &mut s;
println!("{r1}, {r2}, and {r3}");
}