summaryrefslogtreecommitdiff
path: root/variables/src/main.rs
blob: 3a4394a72dc73897c5bd81a611e7ee12bd34510f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
    /* mutability */
    let mut x = 5;
    println!("The variable of x is: {}", x);
    x = 6;
    println!("The variable of x is: {}", x);

    /* shadowing */
    let x = 5;

    let x = x + 1;

    let x = x * 2;

    println!("The value of x is: {}", x);
}