From f72d5ce5856aff13464a7a778c743cf4933cd550 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 6 Sep 2025 17:20:10 +0200 Subject: [PATCH] docs: improve language in methods-and-traits section (#2881) I asked Gemini to review the English for inconsistencies and grammar mistakes. This is the result and I hope it's useful! As a non-native speaker, it is hard for me to evaluate the finer details, so let me know if you would like to see changes (or even better: make them directly in the PR with the suggestion function). --------- Co-authored-by: Dmitri Gribenko --- src/methods-and-traits/deriving.md | 2 +- src/methods-and-traits/exercise.md | 2 +- src/methods-and-traits/methods.md | 2 +- src/methods-and-traits/traits/associated-types.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/methods-and-traits/deriving.md b/src/methods-and-traits/deriving.md index 1c27e407..a577311a 100644 --- a/src/methods-and-traits/deriving.md +++ b/src/methods-and-traits/deriving.md @@ -30,7 +30,7 @@ fn main() { macros to add useful functionality. For example, `serde` can derive serialization support for a struct using `#[derive(Serialize)]`. -- Derivation is usually provided for traits that have a common boilerplate-y +- Derivation is usually provided for traits that have a common boilerplate implementation that is correct for most cases. For example, demonstrate how a manual `Clone` impl can be repetitive compared to deriving the trait: diff --git a/src/methods-and-traits/exercise.md b/src/methods-and-traits/exercise.md index 8b1f02a0..397359be 100644 --- a/src/methods-and-traits/exercise.md +++ b/src/methods-and-traits/exercise.md @@ -5,7 +5,7 @@ minutes: 15 # Exercise: Logger Trait Let's design a simple logging utility, using a trait `Logger` with a `log` -method. Code which might log its progress can then take an `&impl Logger`. In +method. Code that might log its progress can then take an `&impl Logger`. In testing, this might put messages in the test logfile, while in a production build it would send messages to a log server. diff --git a/src/methods-and-traits/methods.md b/src/methods-and-traits/methods.md index 9c8386ae..eed886ac 100644 --- a/src/methods-and-traits/methods.md +++ b/src/methods-and-traits/methods.md @@ -65,7 +65,7 @@ There are several common receivers for a method: transmitted. Complete ownership does not automatically mean mutability. - `mut self`: same as above, but the method can mutate the object. - No receiver: this becomes a static method on the struct. Typically used to - create constructors which are called `new` by convention. + create constructors that are called `new` by convention.
diff --git a/src/methods-and-traits/traits/associated-types.md b/src/methods-and-traits/traits/associated-types.md index beb00e78..e21cb76f 100644 --- a/src/methods-and-traits/traits/associated-types.md +++ b/src/methods-and-traits/traits/associated-types.md @@ -1,6 +1,6 @@ # Associated Types -Associated types are placeholder types which are supplied by the trait +Associated types are placeholder types that are supplied by the trait implementation. ```rust,editable