summaryrefslogtreecommitdiff
path: root/rustlings-macros/info.toml
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-06-27 11:58:44 +0200
committermo8it <mo8it@proton.me>2024-06-27 11:58:44 +0200
commit091e1e7f7a1afad539479674e06cae7c8d8dab7f (patch)
treef458802a4457f5d27252bde62792018a25eda255 /rustlings-macros/info.toml
parent92f249a52ca993d65db6ed70b85535c2f1720ec3 (diff)
traits2 solution
Diffstat (limited to 'rustlings-macros/info.toml')
-rw-r--r--rustlings-macros/info.toml15
1 files changed, 6 insertions, 9 deletions
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml
index 2cc1db6..604f674 100644
--- a/rustlings-macros/info.toml
+++ b/rustlings-macros/info.toml
@@ -755,21 +755,18 @@ https://doc.rust-lang.org/stable/book/ch10-01-syntax.html#in-method-definitions"
name = "traits1"
dir = "15_traits"
hint = """
-A discussion about Traits in Rust can be found at:
-https://doc.rust-lang.org/book/ch10-02-traits.html
-"""
+More about traits in The Book:
+https://doc.rust-lang.org/book/ch10-02-traits.html"""
[[exercises]]
name = "traits2"
dir = "15_traits"
hint = """
-Notice how the trait takes ownership of `self`, and returns `Self`.
-
-Try mutating the incoming string vector. Have a look at the tests to see
-what the result should look like!
+Notice how the trait takes ownership of `self` and returns `Self`.
-Vectors provide suitable methods for adding an element at the end. See
-the documentation at: https://doc.rust-lang.org/std/vec/struct.Vec.html"""
+Although the signature of `append_bar` in the trait takes `self` as argument,
+the implementation can take `mut self` instead. This is possible because the
+the value is owned anyway."""
[[exercises]]
name = "traits3"