From de6075be987eddec6feb8cbfc159cd53d439b8e7 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 28 Dec 2016 19:48:06 -0500 Subject: [PATCH] Fixing more spelling mistakes!!!!! --- dictionary.txt | 3 +++ ...2-03-improving-error-handling-and-modularity.md | 14 +++++++------- src/ch12-04-testing-the-librarys-functionality.md | 8 ++++---- src/ch12-05-working-with-environment-variables.md | 2 +- src/ch12-06-writing-to-stderr-instead-of-stdout.md | 2 +- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dictionary.txt b/dictionary.txt index bcd33ce9b..80b76ed70 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -141,6 +141,7 @@ namespace namespaced namespaces namespacing +newfound nocapture nomicon Nomicon @@ -193,6 +194,7 @@ someusername SpreadsheetCell sqrt stackoverflow +stderr stdin Stdin stdlib @@ -241,5 +243,6 @@ workspace workspaces Workspaces wouldn +writeln WriteMessage yyyy diff --git a/src/ch12-03-improving-error-handling-and-modularity.md b/src/ch12-03-improving-error-handling-and-modularity.md index 2a5193511..41b481669 100644 --- a/src/ch12-03-improving-error-handling-and-modularity.md +++ b/src/ch12-03-improving-error-handling-and-modularity.md @@ -90,8 +90,8 @@ this change, run the program again to verify that the argument parsing still works. It's good to check your progress often, so that you have a better idea of which change caused a problem, should you encounter one. - + @@ -106,12 +106,12 @@ function `parse_config`. The `config` part of the name is saying the two values we return should really be bound together, since they're both part of one configuration value. -> Note: some people call this antipattern of using primitive values when a +> Note: some people call this anti-pattern of using primitive values when a > complex type would be more appropriate *primitive obsession*. Let's introduce a struct to hold all of our configuration. Listing 12-5 shows -the addition of the `Config` struct definition, the refacting of `parse_config`, -and updates to `main`: +the addition of the `Config` struct definition, the refactoring of +`parse_config`, and updates to `main`:
Filename: src/main.rs @@ -159,7 +159,7 @@ struct The signature of `parse_config` now indicates that it returns a `Config` value. In the body of `parse_config`, we used to be returning string slices that were references to `String` values in `args`, but we've defined `Config` to contain -owend `String` values. Because the argument to `parse_config` is a slice of +owned `String` values. Because the argument to `parse_config` is a slice of `String` values, the `Config` instance can't take ownership of the `String` values: that violates Rust's borrowing rules, since the `args` variable in `main` owns the `String` values and is only letting the `parse_config` function @@ -609,7 +609,7 @@ method, and on the `run` function. Now in *src/main.rs*, we need to bring in the code that's now in *src/lib.rs* through `extern crate greprs`. Then we need to add a `use greprs::Config` line -to bring `Corfig` into scope, and prefix the `run` function with our crate name +to bring `Config` into scope, and prefix the `run` function with our crate name as shown in Listing 12-13:
diff --git a/src/ch12-04-testing-the-librarys-functionality.md b/src/ch12-04-testing-the-librarys-functionality.md index 8d95c59fb..a065d3c6d 100644 --- a/src/ch12-04-testing-the-librarys-functionality.md +++ b/src/ch12-04-testing-the-librarys-functionality.md @@ -9,7 +9,7 @@ arguments and check return values without having to call our binary from the command line. We're going to write a function named `grep` that takes our search term and the -text to search and procudes a list of search results. Let's remove that +text to search and produces a list of search results. Let's remove that `println!` from `run` (and from *src/main.rs* as well, as we don't really need those anymore either), and call the new `grep` function with the options we've collected. We'll add a placeholder implementation of the function for now, and @@ -107,7 +107,7 @@ we want to return the parts of that text that match, we know `contents` is the argument that should be connected to the return value using the lifetime syntax. Connecting arguments to return values in the signature is something that other -programming langugages don't make you do, so don't worry if this still feels +programming languages don't make you do, so don't worry if this still feels strange! Knowing how to specify lifetimes gets easier over time, and practice makes perfect. You may want to re-read the above section or go back and compare this example with the Lifetime Syntax section in Chapter 10. @@ -118,7 +118,7 @@ Now let's try running our test: $ cargo test ...warnings... Finished debug [unoptimized + debuginfo] target(s) in 0.43 secs - Running target/debug/deps/greprs-917c5edfc3cf199a + Running target/debug/deps/greprs-abcabcabc running 1 test test test::one_result ... FAILED @@ -262,7 +262,7 @@ Now our whole program should be working! Let's try it out: ```text $ cargo run the poem.txt - Compiling greprs v0.1.0 (file:///C:/Users/steve/tmp/greprs) + Compiling greprs v0.1.0 (file:///projects/greprs) Finished debug [unoptimized + debuginfo] target(s) in 0.38 secs Running `target\debug\greprs.exe the poem.txt` Then there's a pair of us - don't tell! diff --git a/src/ch12-05-working-with-environment-variables.md b/src/ch12-05-working-with-environment-variables.md index 69a039310..8383026e2 100644 --- a/src/ch12-05-working-with-environment-variables.md +++ b/src/ch12-05-working-with-environment-variables.md @@ -1,7 +1,7 @@ ## Working with Environment Variables -Let's add one more feature: case insensitive searching. In addtion, this +Let's add one more feature: case insensitive searching. In addition, this setting won't be a command line option: it'll be an environment variable instead. We could choose to make case insensitivity a command line option, but our users have requested an environment variable that they could set once and diff --git a/src/ch12-06-writing-to-stderr-instead-of-stdout.md b/src/ch12-06-writing-to-stderr-instead-of-stdout.md index 3c2c07806..3efb04d72 100644 --- a/src/ch12-06-writing-to-stderr-instead-of-stdout.md +++ b/src/ch12-06-writing-to-stderr-instead-of-stdout.md @@ -72,7 +72,7 @@ Listing 12-15: Writing error messages to `stderr` instead of `stdout` Rust does not have a convenient function like `println!` for writing to standard error. Instead, we use the `writeln!` macro, which is sort of like `println!`, but it takes an extra argument. The first thing we pass to it is -what to write to. We can aquire a handle to standard error through the +what to write to. We can acquire a handle to standard error through the `std::io::stderr` function. We give a mutable reference to `stderr` to `writeln!`; we need it to be mutable so we can write to it! The second and third arguments to `writeln!` are like the first and second arguments to