diff --git a/src/closures/exercise.md b/src/closures/exercise.md index efb210b5..448ca213 100644 --- a/src/closures/exercise.md +++ b/src/closures/exercise.md @@ -4,8 +4,8 @@ minutes: 10 # Exercise: Log Filter -Building on the generic logger from this morning, implement a `Filter` which -uses a closure to filter log messages, sending those which pass the filtering +Building on the generic logger from this morning, implement a `Filter` that uses +a closure to filter log messages, sending those that pass the filtering predicate to an inner logger. ```rust,compile_fail,editable diff --git a/src/closures/traits.md b/src/closures/traits.md index 1cc391a4..1b7a9bc5 100644 --- a/src/closures/traits.md +++ b/src/closures/traits.md @@ -4,7 +4,7 @@ minutes: 10 # Closure traits -Closures or lambda expressions have types which cannot be named. However, they +Closures or lambda expressions have types that cannot be named. However, they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and [`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits: @@ -67,7 +67,7 @@ can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows the most flexibility for the caller. In contrast, when you have a closure, the most flexible you can have is `Fn` -(which can be passed to a consumer of any of the 3 closure traits), then +(which can be passed to a consumer of any of the three closure traits), then `FnMut`, and lastly `FnOnce`. The compiler also infers `Copy` (e.g. for `add_suffix`) and `Clone` (e.g.