Programmer and System Integration at day, volunteer fire fighter in my free time.
I love to overthink simple things.
let a = 1;
let a_ref = &a;
let a = "foo";
println!("{a_ref}");
and you’ll see that you still have the original value there, you just can't reference it anymore by name because you shadowed it.
let a = 1;
let a_ref = &a;
let a = "foo";
println!("{a_ref}");
and you’ll see that you still have the original value there, you just can't reference it anymore by name because you shadowed it.