You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the Speaker Notes of the type-inference.md (#214)
* Update the Speaker Notes of the type-inference.md
I think this is one of the critical moments in understanding Rust. This behavior is different from many static and dynamic programming languages.
* Fix typo
Co-authored-by: Andrew Walbran <[email protected]>
Copy file name to clipboardExpand all lines: src/basic-syntax/type-inference.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,10 @@ fn main() {
24
24
<details>
25
25
26
26
This slide demonstrates how the Rust compiler infers types based on constraints given by variable declarations and usages.
27
+
28
+
It is very important to emphasize that variables declared like this are not of some sort of dynamic "any type" that can
29
+
hold any data. The machine code generated by such declaration is identical to the explicit declaration of a type.
30
+
The compiler does the job for us and helps us to write a more concise code.
27
31
28
32
The following code tells the compiler to copy into a certain generic container without the code ever explicitly specifying the contained type, using `_` as a placeholder:
0 commit comments