3 ms·
This is pattern matching. They are bound on the left side, and the compiler basically 'solves an equation' to figure out what they are. For instance, if you wr
by Retra 12y ago
This is pattern matching. They are bound on the left side, and the compiler basically 'solves an equation' to figure out what they are.
For instance, if you wrote
5 * a = 35
You know exactly what the value of `a` is because that value matches the given pattern.
Here, you have an equation that looks like
Ok(n) = number_str.parse::<i32>()
So `n` is defined by the value of `number_str.parse::<i32>()`.