From 06ef4cc654e75d22a526812919ee49b8956280bf Mon Sep 17 00:00:00 2001 From: Evan Carroll Date: Mon, 25 May 2020 03:09:11 -0500 Subject: [PATCH 1/6] fix: confine the user further in variable exercises We want to teach a specific lesson. To ensure that we do, let's try to provide more clarity on what the user should not do. --- exercises/variables/variables3.rs | 2 +- exercises/variables/variables5.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 07b1a521..30ec48ff 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -6,6 +6,6 @@ fn main() { let x = 3; println!("Number {}", x); - x = 5; + x = 5; // don't change this line println!("Number {}", x); } diff --git a/exercises/variables/variables5.rs b/exercises/variables/variables5.rs index 47a68a55..5b2c2fa3 100644 --- a/exercises/variables/variables5.rs +++ b/exercises/variables/variables5.rs @@ -4,7 +4,7 @@ // I AM NOT DONE fn main() { - let number = "3"; + let number = "3"; // don't change this line println!("Number {}", number); number = 3; println!("Number {}", number); From cce6a4427718724a9096800754cd3abeca6a1580 Mon Sep 17 00:00:00 2001 From: Thomas Sauvajon Date: Wed, 27 May 2020 18:50:24 +1000 Subject: [PATCH 2/6] fix(option1): Don't add only zeros to the numbers array --- exercises/option/option1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/option/option1.rs b/exercises/option/option1.rs index 2a6c2f77..602ff1a9 100644 --- a/exercises/option/option1.rs +++ b/exercises/option/option1.rs @@ -15,7 +15,7 @@ fn main() { let mut numbers: [Option; 5]; for iter in 0..5 { let number_to_add: u16 = { - ((iter * 5) + 2) / (4 * 16) + ((iter * 1235) + 2) / (4 * 16) }; numbers[iter as usize] = number_to_add; From 0311c03735ddbcd66fff951d8f31f89b29c893c0 Mon Sep 17 00:00:00 2001 From: Dan Wilhelm Date: Wed, 27 May 2020 23:38:38 -0700 Subject: [PATCH 3/6] chore: Limit generics3 lines to 90 chars --- exercises/generics/generics3.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/exercises/generics/generics3.rs b/exercises/generics/generics3.rs index cd3232a4..c76425c3 100644 --- a/exercises/generics/generics3.rs +++ b/exercises/generics/generics3.rs @@ -1,10 +1,11 @@ -// An imaginary magical school has a new report card generation system written in rust! +// An imaginary magical school has a new report card generation system written in Rust! // Currently the system only supports creating report cards where the student's grade -// is represented numerically (e.g. 1.0 -> 5.5). However, the school also issues alphabetical grades -// (A+ -> F-) and needs to be able to print both types of report card! +// is represented numerically (e.g. 1.0 -> 5.5). +// However, the school also issues alphabetical grades (A+ -> F-) and needs +// to be able to print both types of report card! -// Make the necessary code changes to support alphabetical report cards, thereby making the second -// test pass. +// Make the necessary code changes to support alphabetical report cards, thereby making +// the second test pass. // I AM NOT DONE pub struct ReportCard { @@ -15,7 +16,8 @@ pub struct ReportCard { impl ReportCard { pub fn print(&self) -> String { - format!("{} ({}) - achieved a grade of {}", &self.student_name, &self.student_age, &self.grade) + format!("{} ({}) - achieved a grade of {}", + &self.student_name, &self.student_age, &self.grade) } } From 500422d594bb75496b49e95ae104945dcd7c19a6 Mon Sep 17 00:00:00 2001 From: Allan Soares Duarte Date: Thu, 28 May 2020 04:33:15 -0300 Subject: [PATCH 4/6] chore: Update variables6.rs book link --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index e2aa82a7..66d60da2 100644 --- a/info.toml +++ b/info.toml @@ -68,7 +68,7 @@ then keyword 'let'. Constants types must also always be annotated. Read more about constants under 'Differences Between Variables and Constants' in the book's section 'Variables and Mutability': -https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html +https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants """ # IF From e81adc275240308ea49fe4f09f80977d5e6e4dce Mon Sep 17 00:00:00 2001 From: Dan Wilhelm Date: Thu, 28 May 2020 00:35:29 -0700 Subject: [PATCH 5/6] chore: Add Powershell reminder --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c5d399e0..67eff547 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This will install Rustlings and give you access to the `rustlings` command. Run ## Windows -First, set `ExecutionPolicy` to `RemoteSigned`: +In Powershell, set `ExecutionPolicy` to `RemoteSigned`: ```ps Set-ExecutionPolicy RemoteSigned From 9d3f189b0e57152a74dcea5f06030a956adee826 Mon Sep 17 00:00:00 2001 From: Dan Wilhelm Date: Thu, 28 May 2020 14:51:20 -0700 Subject: [PATCH 6/6] chore: Fix PowerShell capitalization --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67eff547..0fd6cd7f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This will install Rustlings and give you access to the `rustlings` command. Run ## Windows -In Powershell, set `ExecutionPolicy` to `RemoteSigned`: +In PowerShell, set `ExecutionPolicy` to `RemoteSigned`: ```ps Set-ExecutionPolicy RemoteSigned