From 9a13bccd6305a83635993b9e2f80422a35566ee3 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Wed, 17 Apr 2024 01:35:29 -0700 Subject: [PATCH 1/9] chore: changes from formatting on save --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 226d4137..515dc50e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,9 +2,9 @@ name: Rustlings Tests on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] env: CARGO_TERM_COLOR: always From 4eec81a1131a3159bce2131266a8d62d98212741 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Wed, 17 Apr 2024 01:35:53 -0700 Subject: [PATCH 2/9] ci: add `clippy` job to `rust.yml` workflow --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 515dc50e..689d05e1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,6 +10,11 @@ env: CARGO_TERM_COLOR: always jobs: + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: cargo clippy -- --deny warnings fmt: runs-on: ubuntu-latest steps: From 881d3e9441507a4f615699d1cd77f4d989d20872 Mon Sep 17 00:00:00 2001 From: allupeng Date: Sun, 28 Apr 2024 18:03:22 +0800 Subject: [PATCH 3/9] doc : add a dot in structs3.rs file --- exercises/07_structs/structs3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07_structs/structs3.rs b/exercises/07_structs/structs3.rs index 7cda5af1..2d55dd7e 100644 --- a/exercises/07_structs/structs3.rs +++ b/exercises/07_structs/structs3.rs @@ -1,7 +1,7 @@ // structs3.rs // // Structs contain data, but can also have logic. In this exercise we have -// defined the Package struct and we want to test some logic attached to it. +// defined the Package struct, and we want to test some logic attached to it. // Make the code compile and the tests pass! // // Execute `rustlings hint structs3` or use the `hint` watch subcommand for a From 8c3b8dcec47ae1ab08d88eaa4df522b4c30e14cc Mon Sep 17 00:00:00 2001 From: allupeng Date: Mon, 29 Apr 2024 14:18:04 +0800 Subject: [PATCH 4/9] doc : add a dot in hashmaps1.rs file to fill e.g. --- exercises/11_hashmaps/hashmaps1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/11_hashmaps/hashmaps1.rs b/exercises/11_hashmaps/hashmaps1.rs index 80829eaa..02f4725e 100644 --- a/exercises/11_hashmaps/hashmaps1.rs +++ b/exercises/11_hashmaps/hashmaps1.rs @@ -3,7 +3,7 @@ // A basket of fruits in the form of a hash map needs to be defined. The key // represents the name of the fruit and the value represents how many of that // particular fruit is in the basket. You have to put at least three different -// types of fruits (e.g apple, banana, mango) in the basket and the total count +// types of fruits (e.g. apple, banana, mango) in the basket and the total count // of all the fruits should be at least five. // // Make me compile and pass the tests! From 01509a2a84498e2814505e650994ac03062ffd0c Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 12 May 2024 22:44:46 +0200 Subject: [PATCH 5/9] Remove comma --- exercises/07_structs/structs3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07_structs/structs3.rs b/exercises/07_structs/structs3.rs index 2d55dd7e..7cda5af1 100644 --- a/exercises/07_structs/structs3.rs +++ b/exercises/07_structs/structs3.rs @@ -1,7 +1,7 @@ // structs3.rs // // Structs contain data, but can also have logic. In this exercise we have -// defined the Package struct, and we want to test some logic attached to it. +// defined the Package struct and we want to test some logic attached to it. // Make the code compile and the tests pass! // // Execute `rustlings hint structs3` or use the `hint` watch subcommand for a From 01a78531ad40982d25a70c0a2393e39e21f666f2 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Sun, 12 May 2024 15:10:50 -0700 Subject: [PATCH 6/9] refactor: remove `referent` to improve readability --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 5690701d..9fdc9a4f 100644 --- a/info.toml +++ b/info.toml @@ -378,7 +378,7 @@ path = "exercises/06_move_semantics/move_semantics5.rs" mode = "test" hint = """ Carefully reason about the range in which each mutable reference is in -scope. Does it help to update the value of referent (`x`) immediately after +scope. Does it help to update the value of `x` immediately after the mutable reference is taken? Read more about 'Mutable References' in the book's section 'References and Borrowing': https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references. From 5337620476526526544ce20b889043d6df69b13c Mon Sep 17 00:00:00 2001 From: Javier Kauer Date: Tue, 14 May 2024 12:10:47 +0200 Subject: [PATCH 7/9] docs: improved syntaxis of hint of traits4 and traits5 --- info.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info.toml b/info.toml index 5690701d..ab403232 100644 --- a/info.toml +++ b/info.toml @@ -816,7 +816,7 @@ path = "exercises/15_traits/traits4.rs" mode = "test" hint = """ Instead of using concrete types as parameters you can use traits. Try replacing -the '??' with 'impl ' +the '??' with 'impl [what goes here?]' See the documentation at: https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters """ @@ -827,7 +827,7 @@ path = "exercises/15_traits/traits5.rs" mode = "compile" hint = """ To ensure a parameter implements multiple traits use the '+ syntax'. Try -replacing the '??' with 'impl <> + <>'. +replacing the '??' with 'impl [what goes here?] + [what goes here?]'. See the documentation at: https://doc.rust-lang.org/book/ch10-02-traits.html#specifying-multiple-trait-bounds-with-the--syntax """ From 1ede3a82e9df4a0cd93110e49722701946b41e11 Mon Sep 17 00:00:00 2001 From: jphilis <117293564+jphilis@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:55:34 +0200 Subject: [PATCH 8/9] chore: update error message to error message given by rustc. error[E0596] --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index e8c19bf4..ba9b6e3d 100644 --- a/info.toml +++ b/info.toml @@ -318,7 +318,7 @@ name = "move_semantics1" path = "exercises/06_move_semantics/move_semantics1.rs" mode = "test" hint = """ -So you've got the "cannot borrow immutable local variable `vec` as mutable" +So you've got the "cannot borrow `vec` as mutable, as it is not declared as mutable" error on the line where we push an element to the vector, right? The fix for this is going to be adding one keyword, and the addition is NOT on From f0849447adb1f92f3ca48f7326ad493667160464 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Wed, 26 Jun 2024 19:05:04 -0700 Subject: [PATCH 9/9] chore(from_into): Add missing period in docs --- exercises/23_conversions/from_into.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/23_conversions/from_into.rs b/exercises/23_conversions/from_into.rs index 11787c37..10836a6d 100644 --- a/exercises/23_conversions/from_into.rs +++ b/exercises/23_conversions/from_into.rs @@ -39,7 +39,7 @@ impl Default for Person { // 5. Extract the other element from the split operation and parse it into a // `usize` as the age. // If while parsing the age, something goes wrong, then return the default of -// Person Otherwise, then return an instantiated Person object with the results +// Person. Otherwise, then return an instantiated Person object with the results // I AM NOT DONE