Merge pull request #423 from MujeebullahKalwar/typo-fixes

Typo Fixes
This commit is contained in:
Sunface
2023-08-11 10:56:33 +08:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@ -245,7 +245,7 @@ fn main() {
10.
```rust
/* Fill in the blank and fix the errror */
/* Fill in the blank and fix the error */
// You can also use `impl FnOnce(i32) -> i32`
fn create_fn() -> impl Fn(i32) -> i32 {
let num = 5;
@ -261,11 +261,11 @@ fn main() {
```
```rust
/* Fill in the blank and fix the errror */
/* Fill in the blank and fix the error */
fn create_fn() -> Box<dyn Fn(i32) -> i32> {
let num = 5;
// how does the following closure capture the evironment variable `num`
// how does the following closure capture the environment variable `num`
// &T, &mut T, T ?
Box::new(move |x| x + num)
}