From 81edc4234fbe40eee34f83bbc2995c69f9e1e07c Mon Sep 17 00:00:00 2001 From: mokou Date: Mon, 11 Jul 2022 13:43:41 +0200 Subject: [PATCH] fix(variables): reorder and redo hint texts --- exercises/variables/variables1.rs | 2 +- exercises/variables/variables2.rs | 6 +++--- exercises/variables/variables3.rs | 6 ++---- exercises/variables/variables4.rs | 6 ++++-- exercises/variables/variables5.rs | 2 +- exercises/variables/variables6.rs | 2 +- info.toml | 16 ++++++++-------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index d1af8311..f4d182ac 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -1,6 +1,6 @@ // variables1.rs // Make me compile! -// Execute the command `rustlings hint variables1` if you want a hint :) +// Execute `rustlings hint variables1` or use the `hint` watch subcommand for a hint. // I AM NOT DONE diff --git a/exercises/variables/variables2.rs b/exercises/variables/variables2.rs index 7774a8fb..641aeb8e 100644 --- a/exercises/variables/variables2.rs +++ b/exercises/variables/variables2.rs @@ -1,13 +1,13 @@ // variables2.rs -// Make me compile! Execute the command `rustlings hint variables2` if you want a hint :) +// Execute `rustlings hint variables2` or use the `hint` watch subcommand for a hint. // I AM NOT DONE fn main() { let x; if x == 10 { - println!("Ten!"); + println!("x is ten!"); } else { - println!("Not ten!"); + println!("x is not ten!"); } } diff --git a/exercises/variables/variables3.rs b/exercises/variables/variables3.rs index 30ec48ff..819b1bc7 100644 --- a/exercises/variables/variables3.rs +++ b/exercises/variables/variables3.rs @@ -1,11 +1,9 @@ // variables3.rs -// Make me compile! Execute the command `rustlings hint variables3` if you want a hint :) +// Execute `rustlings hint variables3` or use the `hint` watch subcommand for a hint. // I AM NOT DONE fn main() { - let x = 3; - println!("Number {}", x); - x = 5; // don't change this line + let x: i32; println!("Number {}", x); } diff --git a/exercises/variables/variables4.rs b/exercises/variables/variables4.rs index 77f1e9ab..54491b0a 100644 --- a/exercises/variables/variables4.rs +++ b/exercises/variables/variables4.rs @@ -1,9 +1,11 @@ // variables4.rs -// Make me compile! Execute the command `rustlings hint variables4` if you want a hint :) +// Execute `rustlings hint variables4` or use the `hint` watch subcommand for a hint. // I AM NOT DONE fn main() { - let x: i32; + let x = 3; + println!("Number {}", x); + x = 5; // don't change this line println!("Number {}", x); } diff --git a/exercises/variables/variables5.rs b/exercises/variables/variables5.rs index 175eebb3..7042d6fa 100644 --- a/exercises/variables/variables5.rs +++ b/exercises/variables/variables5.rs @@ -1,5 +1,5 @@ // variables5.rs -// Make me compile! Execute the command `rustlings hint variables5` if you want a hint :) +// Execute `rustlings hint variables5` or use the `hint` watch subcommand for a hint. // I AM NOT DONE diff --git a/exercises/variables/variables6.rs b/exercises/variables/variables6.rs index 98666914..a8520122 100644 --- a/exercises/variables/variables6.rs +++ b/exercises/variables/variables6.rs @@ -1,5 +1,5 @@ // variables6.rs -// Make me compile! Execute the command `rustlings hint variables6` if you want a hint :) +// Execute `rustlings hint variables6` or use the `hint` watch subcommand for a hint. // I AM NOT DONE diff --git a/info.toml b/info.toml index f3a52177..c5f22f92 100644 --- a/info.toml +++ b/info.toml @@ -43,20 +43,20 @@ name = "variables3" path = "exercises/variables/variables3.rs" mode = "compile" hint = """ -In Rust, variable bindings are immutable by default. But here we're trying -to reassign a different value to x! There's a keyword we can use to make -a variable binding mutable instead.""" +Oops! In this exercise, we have a variable binding that we've created on +line 7, and we're trying to use it on line 8, but we haven't given it a +value. We can't print out something that isn't there; try giving x a value! +This is an error that can cause bugs that's very easy to make in any +programming language -- thankfully the Rust compiler has caught this for us!""" [[exercises]] name = "variables4" path = "exercises/variables/variables4.rs" mode = "compile" hint = """ -Oops! In this exercise, we have a variable binding that we've created on -line 7, and we're trying to use it on line 8, but we haven't given it a -value. We can't print out something that isn't there; try giving x a value! -This is an error that can cause bugs that's very easy to make in any -programming language -- thankfully the Rust compiler has caught this for us!""" +In Rust, variable bindings are immutable by default. But here we're trying +to reassign a different value to x! There's a keyword we can use to make +a variable binding mutable instead.""" [[exercises]] name = "variables5"