diff --git a/src/doc/book/closures.md b/src/doc/book/closures.md index a6b4e9492181c..e8c88b7db0699 100644 --- a/src/doc/book/closures.md +++ b/src/doc/book/closures.md @@ -339,7 +339,7 @@ fn call_with_ref<'a, F>(some_closure:F) -> i32 where F: Fn(&'a 32) -> i32 { ``` -However this presents a problem with in our case. When you specify the explict +However this presents a problem with in our case. When you specify the explicit lifetime on a function it binds that lifetime to the *entire* scope of the function instead of just the invocation scope of our closure. This means that the borrow checker will see a mutable reference in the same lifetime as our immutable reference and fail @@ -354,7 +354,7 @@ fn call_with_ref(some_closure:F) -> i32 ``` This lets the Rust compiler find the minimum lifetime to invoke our closure and -satisfy the borrow checker's rules. Our function then compiles and excutes as we +satisfy the borrow checker's rules. Our function then compiles and executes as we expect. ```rust diff --git a/src/doc/book/testing.md b/src/doc/book/testing.md index 7954085472e50..86729147ed065 100644 --- a/src/doc/book/testing.md +++ b/src/doc/book/testing.md @@ -431,7 +431,7 @@ one. Cargo will ignore files in subdirectories of the `tests/` directory. Therefore shared modules in integrations tests are possible. -For example `tests/common/mod.rs` is not seperatly compiled by cargo but can +For example `tests/common/mod.rs` is not separately compiled by cargo but can be imported in every test with `mod common;` That's all there is to the `tests` directory. The `tests` module isn't needed