Skip to content

Commit 120f75b

Browse files
authored
Merge pull request #269 from mmerkes/patch-1
Tidies up grammar impl-draft.md
2 parents e5c4f01 + d2abf86 commit 120f75b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/tutorial/impl-draft.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Our `main` function only contains this line right now:
99
{{#include impl-draft.rs:13:13}}
1010
```
1111

12-
(We drop the `println` statement that we merely put there temporarily
13-
to demonstrate that our program works as expected.)
12+
We can drop the `println` statement that we put there temporarily
13+
to demonstrate that our program works as expected.
1414

1515
Let’s start by opening the file we got.
1616

@@ -23,10 +23,10 @@ Let’s start by opening the file we got.
2323
**Note:**
2424
See that [`.expect`] method here?
2525
This is a shortcut function that will make the program exit immediately
26-
when the value (in this case the input file)
26+
when the value (in this case, the input file)
2727
could not be read.
2828
It's not very pretty,
29-
and in the next chapter on [Nicer error reporting]
29+
and in the next chapter on [Nicer error reporting],
3030
we will look at how to improve this.
3131

3232
[`.expect`]: https://doc.rust-lang.org/1.39.0/std/result/enum.Result.html#method.expect
@@ -54,9 +54,8 @@ Give it a try: `cargo run -- main src/main.rs` should work now!
5454
<aside class="exercise">
5555

5656
**Exercise for the reader:**
57-
This is not the best implementation:
58-
It will read the whole file into memory
59-
– however large the file may be.
57+
This is not the best implementation as
58+
it will read the whole file into memory, no matter how large the file may be.
6059
Find a way to optimize it!
6160
(One idea might be to use a [`BufReader`]
6261
instead of `read_to_string()`.)

0 commit comments

Comments
 (0)