@@ -225,7 +225,7 @@ sense to put it into a function:
225225``` rust
226226# fn find (_ : & str , _ : char ) -> Option <usize > { None }
227227// Returns the extension of the given file name, where the extension is defined
228- // as all characters proceding the first `.`.
228+ // as all characters proceeding the first `.`.
229229// If `file_name` has no `.`, then `None` is returned.
230230fn extension_explicit (file_name : & str ) -> Option <& str > {
231231 match find (file_name , '.' ) {
@@ -272,7 +272,7 @@ to get rid of the case analysis:
272272``` rust
273273# fn find (_ : & str , _ : char ) -> Option <usize > { None }
274274// Returns the extension of the given file name, where the extension is defined
275- // as all characters proceding the first `.`.
275+ // as all characters proceeding the first `.`.
276276// If `file_name` has no `.`, then `None` is returned.
277277fn extension (file_name : & str ) -> Option <& str > {
278278 find (file_name , '.' ). map (| i | & file_name [i + 1 .. ])
@@ -755,7 +755,7 @@ fn main() {
755755(N.B. The ` AsRef<Path> ` is used because those are the
756756[ same bounds used on
757757` std::fs::File::open ` ] ( ../std/fs/struct.File.html#method.open ) .
758- This makes it ergnomic to use any kind of string as a file path.)
758+ This makes it ergonomic to use any kind of string as a file path.)
759759
760760There are three different errors that can occur here:
761761
@@ -1552,7 +1552,7 @@ parser and a help message from a vector of options (The fact that it
15521552is a vector is hidden behind a struct and a set of methods). Once the
15531553parsing is done, we can decode the program arguments into a Rust
15541554struct. From there, we can get information about the flags, for
1555- instance, wether they were passed in, and what arguments they
1555+ instance, whether they were passed in, and what arguments they
15561556had. Here's our program with the appropriate ` extern crate `
15571557statements, and the basic argument setup for Getopts:
15581558
@@ -1594,7 +1594,7 @@ then store the first one, knowing that it is our program's name. Once
15941594that's done, we set up our argument flags, in this case a simplistic
15951595help message flag. Once we have the argument flags set up, we use
15961596` Options.parse ` to parse the argument vector (starting from index one,
1597- becouse index 0 is the program name). If this was successful, we
1597+ because index 0 is the program name). If this was successful, we
15981598assign matches to the parsed object, if not, we panic. Once past that,
15991599we test if the user passed in the help flag, and if so print the usage
16001600message. The option help messages are constructed by Getopts, so all
@@ -1896,7 +1896,7 @@ for pop in search(&data_file, &city) {
18961896...
18971897```
18981898
1899- In this peice of code, we take ` file ` (which has the type
1899+ In this piece of code, we take ` file ` (which has the type
19001900` Option<String> ` ), and convert it to a type that ` search ` can use, in
19011901this case, ` &Option<AsRef<Path>> ` . Do do this, we take a reference of
19021902file, and map ` Path::new ` onto it. In this case, ` as_ref() ` converts
@@ -2120,7 +2120,7 @@ heuristics!
21202120 and
21212121 [ ` Error ` ] ( ../std/error/trait.Error.html )
21222122 impls to make the [ ` try! ` ] ( ../std/macro.try!.html )
2123- macro more ergnomic .
2123+ macro more ergonomic .
21242124* If you're writing a library and your code can produce errors, define your own
21252125 error type and implement the
21262126 [ ` std::error::Error ` ] ( ../std/error/trait.Error.html )
0 commit comments