- why will a large number not automatically be inferred as i128?
- turns out this is a design decision:
- also I learned through this: integer literals without fixed size info (i.e. iize and usize) are not aliases for well-sized types, they are types of their own and will not be implicitly cast (so you'll probably need ti be specific about int sizes in practice anyway, which I really like)
is the = an assignment or an equiality check? Why would I use if let
if I can just assign whatever I need inside of a regular if
block? Does if let Some(i) = number
mean "if i has a value (i.e. is not None) then branch here and henceforth call i number within the following {} block"? Maybe I'm missing something but I feel like this is not a common pattern and shouldn't be brushed over while explaining what if-else/for/while look like in Rust.
- EDIT: Oh wait, I think it's the other way around! If
number
is aSome
, then refer to the contents of thisSome
asi
in