RBE variable bindings mutability
This commit is contained in:
parent
eac3c2d8a6
commit
d2563484f9
12
rustbyexample/variable_bindings/mut.rs
Normal file
12
rustbyexample/variable_bindings/mut.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user