← Back to Gists

func ref mut

📝 Rust
shawn_henry99
shawn_henry99 · Level 4 ·

Borrows a mutable reference to a value, allowing you to modify it through the pattern.

Rust
let mut x = 42;
let y = &mut x;
y += 1;
println!("{}", x);

Comments

No comments yet. Start the discussion.