box-o-sand/rustbyexample/variable_bindings/mut.rs

13 lines
248 B
Rust
Raw Normal View History

2021-09-29 15:38:53 +00:00
fn main() {
let _immutable_binding = 1;
let mut mutable_binding = 1;
println!("Before mutation: {}", mutable_binding);
mutable_binding += 1;
println!("After mutation: {}", mutable_binding);
// _immutable_binding += 1;
}