Comment by tialaramex
Comment by tialaramex 3 days ago
Which x? There are two in your code, one for each time you introduce a pattern Some(x) and each x has scope which of course ends when that pattern is done with
Notice that the Python doesn't work this way, we didn't make a new variable but instead changed the existing one.
Also, the intent in the Python was a constant, in Rust we'd give this constant an uppercase name by convention, but regardless it's a constant and so of course matching against a constant does what you expect, it can't re-bind a constant, 404 is a constant and so is `const NOT_FOUND: u16 = 404;`
> Which x? There are two in your code, one for each time you introduce a pattern Some(x) and each x has scope which of course ends when that pattern is done with
if each x's scope ends at the end of each case doesn't that mean there's only one x?
> we didn't make a new variable but instead changed the existing one.
so because python doesn't have scopes except for function scopes it shouldn't ever have any new features that intersect with scope?