@@ -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
1515Let’s start by opening the file we got.
1616
@@ -23,10 +23,10 @@ Let’s start by opening the file we got.
2323** Note:**
2424See that [ ` .expect ` ] method here?
2525This 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)
2727could not be read.
2828It's not very pretty,
29- and in the next chapter on [ Nicer error reporting]
29+ and in the next chapter on [ Nicer error reporting] ,
3030we 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.
6059Find a way to optimize it!
6160(One idea might be to use a [ ` BufReader ` ]
6261instead of ` read_to_string() ` .)
0 commit comments