Skip to content

Commit d97d111

Browse files
jonas-schievinkmark-i-m
authored andcommitted
Fix a few typos in type inference chapter
Also try to test the top example
1 parent f53c6a6 commit d97d111

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/type-inference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ expression.
66
It is what allows Rust to work with fewer or no type annotations,
77
making things easier for users:
88

9-
```rust,ignore
9+
```rust
1010
fn main() {
1111
let mut things = vec![];
12-
things.push("thing")
12+
things.push("thing");
1313
}
1414
```
1515

16-
Here, the type of `things` is *inferenced* to be `&str` because that's the value
16+
Here, the type of `things` is *inferred* to be `Vec<&str>` because of the value
1717
we push into `things`.
1818

1919
The type inference is based on the standard Hindley-Milner (HM) type inference

0 commit comments

Comments
 (0)