From f5e4c16eed0c9e86398284bb6732981c3cc074c8 Mon Sep 17 00:00:00 2001 From: mokou Date: Thu, 14 Jul 2022 12:18:21 +0200 Subject: [PATCH] feat(strings): move before modules --- exercises/strings/strings1.rs | 2 +- exercises/strings/strings2.rs | 2 +- info.toml | 46 +++++++++++++++++------------------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/exercises/strings/strings1.rs b/exercises/strings/strings1.rs index 8090244..0de86a1 100644 --- a/exercises/strings/strings1.rs +++ b/exercises/strings/strings1.rs @@ -1,6 +1,6 @@ // strings1.rs // Make me compile without changing the function signature! -// Execute `rustlings hint strings1` for hints ;) +// Execute `rustlings hint strings1` or use the `hint` watch subcommand for a hint. // I AM NOT DONE diff --git a/exercises/strings/strings2.rs b/exercises/strings/strings2.rs index 5a2ce74..0c48ec9 100644 --- a/exercises/strings/strings2.rs +++ b/exercises/strings/strings2.rs @@ -1,6 +1,6 @@ // strings2.rs // Make me compile without changing the function signature! -// Execute `rustlings hint strings2` for hints :) +// Execute `rustlings hint strings2` or use the `hint` watch subcommand for a hint. // I AM NOT DONE diff --git a/info.toml b/info.toml index b1e448c..8174fc8 100644 --- a/info.toml +++ b/info.toml @@ -420,6 +420,29 @@ and then create a match expression in `process()`. Note that you need to deconstruct some message variants in the match expression to get value in the variant.""" +# STRINGS + +[[exercises]] +name = "strings1" +path = "exercises/strings/strings1.rs" +mode = "compile" +hint = """ +The `current_favorite_color` function is currently returning a string slice with the `'static` +lifetime. We know this because the data of the string lives in our code itself -- it doesn't +come from a file or user input or another program -- so it will live as long as our program +lives. But it is still a string slice. There's one way to create a `String` by converting a +string slice covered in the Strings chapter of the book, and another way that uses the `From` +trait.""" + +[[exercises]] +name = "strings2" +path = "exercises/strings/strings2.rs" +mode = "compile" +hint = """ +Yes, it would be really easy to fix this by just changing the value bound to `word` to be a +string slice instead of a `String`, wouldn't it?? There is a way to add one character to line +9, though, that will coerce the `String` into a string slice.""" + # MODULES [[exercises]] @@ -472,29 +495,6 @@ Use the `entry()` and `or_insert()` methods of `HashMap` to achieve this. Learn more at https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-value-if-the-key-has-no-value """ -# STRINGS - -[[exercises]] -name = "strings1" -path = "exercises/strings/strings1.rs" -mode = "compile" -hint = """ -The `current_favorite_color` function is currently returning a string slice with the `'static` -lifetime. We know this because the data of the string lives in our code itself -- it doesn't -come from a file or user input or another program -- so it will live as long as our program -lives. But it is still a string slice. There's one way to create a `String` by converting a -string slice covered in the Strings chapter of the book, and another way that uses the `From` -trait.""" - -[[exercises]] -name = "strings2" -path = "exercises/strings/strings2.rs" -mode = "compile" -hint = """ -Yes, it would be really easy to fix this by just changing the value bound to `word` to be a -string slice instead of a `String`, wouldn't it?? There is a way to add one character to line -9, though, that will coerce the `String` into a string slice.""" - # TEST 2 [[exercises]]