From 7e04c7ff1068802edd61585389587d926eaba6e7 Mon Sep 17 00:00:00 2001 From: Michele Sessa Date: Wed, 12 Oct 2022 15:21:05 +0100 Subject: [PATCH] docs(easy_traits): fix prototype error and add pub where necessary also improve the arguments names --- subjects/easy_traits/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subjects/easy_traits/README.md b/subjects/easy_traits/README.md index 6e1629a71..544a31371 100644 --- a/subjects/easy_traits/README.md +++ b/subjects/easy_traits/README.md @@ -15,16 +15,16 @@ The trait `AppendStr` has the following functions: ```rust #[derive(Clone)] -struct StringValue { - value: String, +pub struct StringValue { + pub value: String, } -trait AppendStr { - fn append_str(self, new_str: String) -> Self; +pub trait AppendStr { + fn append_str(&mut self, str_to_append: String) -> Self; - fn append_number(self, new_number: f64) -> Self; + fn append_number(&mut self, nb_to_append: f64) -> Self; - fn remove_punctuation_marks(self) -> Self; + fn remove_punctuation_marks(&mut self) -> Self; } impl AppendStr for StringValue {