This has probably been asked before but I couldn't find anything..
In Go, you are able to do something like this
v1 := 3
v2 := 4
if v := v1 - v2; v < 4 {
// use v
}
In rust, I couldn't find a way to do it with if let bindings
let v1 = 3;
let v2 = 4;
// able to match an exact value
if let v @ 4 = v1 - v2 {}
// but unable to match a range of value like in a `match` block
if let v @ (0..4) = v1 - v2 {}
if let v (if v < 4) = v1 - v2 {}
Of course declaring v outside works but is kind of awkward since it is only used in the if block