From 4a384cae4ac735e243bbc58184b1f409e914ddc5 Mon Sep 17 00:00:00 2001 From: Zerotask Date: Sat, 24 Apr 2021 12:12:49 +0200 Subject: [PATCH 01/92] docs(option): improve further information --- exercises/option/README.md | 2 ++ exercises/option/option1.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/option/README.md b/exercises/option/README.md index a304bb44..89c00289 100644 --- a/exercises/option/README.md +++ b/exercises/option/README.md @@ -16,3 +16,5 @@ Option types are very common in Rust code, as they have a number of uses: - [Option Enum Format](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html#in-enum-definitions) - [Option Module Documentation](https://doc.rust-lang.org/std/option/) - [Option Enum Documentation](https://doc.rust-lang.org/std/option/enum.Option.html) +- [if let](https://doc.rust-lang.org/rust-by-example/flow_control/if_let.html) +- [while let](https://doc.rust-lang.org/rust-by-example/flow_control/while_let.html) diff --git a/exercises/option/option1.rs b/exercises/option/option1.rs index 602ff1a9..17cf4f60 100644 --- a/exercises/option/option1.rs +++ b/exercises/option/option1.rs @@ -3,7 +3,7 @@ // I AM NOT DONE -// you can modify anything EXCEPT for this function's sig +// you can modify anything EXCEPT for this function's signature fn print_number(maybe_number: Option) { println!("printing: {}", maybe_number.unwrap()); } From 21c9f44168394e08338fd470b5f49b1fd235986f Mon Sep 17 00:00:00 2001 From: apogeeoak <59737221+apogeeoak@users.noreply.github.com> Date: Sat, 24 Apr 2021 13:15:34 -0400 Subject: [PATCH 02/92] feat(intro): Add intro section. --- exercises/intro/README.md | 8 ++++++++ exercises/intro/intro1.rs | 19 +++++++++++++++++++ exercises/intro/intro2.rs | 9 +++++++++ exercises/variables/variables1.rs | 8 ++------ info.toml | 16 ++++++++++++++++ 5 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 exercises/intro/README.md create mode 100644 exercises/intro/intro1.rs create mode 100644 exercises/intro/intro2.rs diff --git a/exercises/intro/README.md b/exercises/intro/README.md new file mode 100644 index 00000000..d32e4a8b --- /dev/null +++ b/exercises/intro/README.md @@ -0,0 +1,8 @@ +# Intro + +Rust uses the `print!` and `println!` macros to print text to the console. + +## Further information + +- [Hello World](https://doc.rust-lang.org/rust-by-example/hello.html) +- [Formatted print](https://doc.rust-lang.org/rust-by-example/hello/print.html) diff --git a/exercises/intro/intro1.rs b/exercises/intro/intro1.rs new file mode 100644 index 00000000..83a78e68 --- /dev/null +++ b/exercises/intro/intro1.rs @@ -0,0 +1,19 @@ +// intro1.rs +// About this `I AM NOT DONE` thing: +// We sometimes encourage you to keep trying things on a given exercise, even +// after you already figured it out. If you got everything working and feel +// ready for the next exercise, remove the `I AM NOT DONE` comment below. +// Execute the command `rustlings hint intro1` for a hint. + +// I AM NOT DONE + +fn main() { + println!("Hello and"); + println!(r#" welcome to... "#); + println!(r#" _ _ _ "#); + println!(r#" _ __ _ _ ___| |_| (_)_ __ __ _ ___ "#); + println!(r#" | '__| | | / __| __| | | '_ \ / _` / __| "#); + println!(r#" | | | |_| \__ \ |_| | | | | | (_| \__ \ "#); + println!(r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "#); + println!(r#" |___/ "#); +} diff --git a/exercises/intro/intro2.rs b/exercises/intro/intro2.rs new file mode 100644 index 00000000..97a073f0 --- /dev/null +++ b/exercises/intro/intro2.rs @@ -0,0 +1,9 @@ +// intro2.rs +// Make the code print a greeting to the world. +// Execute `rustlings hint intro2` for a hint. + +// I AM NOT DONE + +fn main() { + println!("Hello {}!"); +} diff --git a/exercises/variables/variables1.rs b/exercises/variables/variables1.rs index 4a3af73c..d1af8311 100644 --- a/exercises/variables/variables1.rs +++ b/exercises/variables/variables1.rs @@ -1,10 +1,6 @@ // variables1.rs -// Make me compile! Execute the command `rustlings hint variables1` if you want a hint :) - -// About this `I AM NOT DONE` thing: -// We sometimes encourage you to keep trying things on a given exercise, -// even after you already figured it out. If you got everything working and -// feel ready for the next exercise, remove the `I AM NOT DONE` comment below. +// Make me compile! +// Execute the command `rustlings hint variables1` if you want a hint :) // I AM NOT DONE diff --git a/info.toml b/info.toml index 82e11952..c56b19fd 100644 --- a/info.toml +++ b/info.toml @@ -1,3 +1,19 @@ +# INTRO + +[[exercises]] +name = "intro1" +path = "exercises/intro/intro1.rs" +mode = "compile" +hint = """ +Remove the I AM NOT DONE comment to move on to the next exercise.""" + +[[exercises]] +name = "intro2" +path = "exercises/intro/intro2.rs" +mode = "compile" +hint = """ +Add an argument after the format string.""" + # VARIABLES [[exercises]] From 9b8de65525a5576b78cf0c8e4098cdd34296338f Mon Sep 17 00:00:00 2001 From: apogeeoak <59737221+apogeeoak@users.noreply.github.com> Date: Mon, 26 Apr 2021 20:28:17 -0400 Subject: [PATCH 03/92] fix(intro1): Add compiler error explanation. --- exercises/intro/intro1.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/intro/intro1.rs b/exercises/intro/intro1.rs index 83a78e68..1c4582de 100644 --- a/exercises/intro/intro1.rs +++ b/exercises/intro/intro1.rs @@ -16,4 +16,8 @@ fn main() { println!(r#" | | | |_| \__ \ |_| | | | | | (_| \__ \ "#); println!(r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "#); println!(r#" |___/ "#); + println!(); + println!("This exercise compiles successfully. The remaining exercises contain a compiler"); + println!("or logic error. The central concept behind Rustlings is to fix these errors and"); + println!("solve the exercises. Good luck!"); } From f78c48020830d7900dd8d81f355606581670446d Mon Sep 17 00:00:00 2001 From: apogeeoak <59737221+apogeeoak@users.noreply.github.com> Date: Tue, 27 Apr 2021 17:09:44 -0400 Subject: [PATCH 04/92] fix(cli): Move long text strings into constants. --- default_out.txt | 25 ------------ src/main.rs | 104 +++++++++++++++++++++++++++++------------------- 2 files changed, 64 insertions(+), 65 deletions(-) delete mode 100644 default_out.txt diff --git a/default_out.txt b/default_out.txt deleted file mode 100644 index b90d1e3a..00000000 --- a/default_out.txt +++ /dev/null @@ -1,25 +0,0 @@ -Thanks for installing Rustlings! - -Is this your first time? Don't worry, Rustlings was made for beginners! We are -going to teach you a lot of things about Rust, but before we can get -started, here's a couple of notes about how Rustlings operates: - -1. The central concept behind Rustlings is that you solve exercises. These - exercises usually have some sort of syntax error in them, which will cause - them to fail compilation or testing. Sometimes there's a logic error instead - of a syntax error. No matter what error, it's your job to find it and fix it! - You'll know when you fixed it because then, the exercise will compile and - Rustlings will be able to move on to the next exercise. -2. If you run Rustlings in watch mode (which we recommend), it'll automatically - start with the first exercise. Don't get confused by an error message popping - up as soon as you run Rustlings! This is part of the exercise that you're - supposed to solve, so open the exercise file in an editor and start your - detective work! -3. If you're stuck on an exercise, there is a helpful hint you can view by typing - 'hint' (in watch mode), or running `rustlings hint myexercise`. -4. If an exercise doesn't make sense to you, feel free to open an issue on GitHub! - (https://github.com/rust-lang/rustlings/issues/new). We look at every issue, - and sometimes, other learners do too so you can help each other out! - -Got all that? Great! To get started, run `rustlings watch` in order to get the first -exercise. Make sure to have your editor open! diff --git a/src/main.rs b/src/main.rs index a80ce88e..64161e58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,15 +107,7 @@ fn main() { } if args.nested.is_none() { - println!(); - println!(r#" welcome to... "#); - println!(r#" _ _ _ "#); - println!(r#" _ __ _ _ ___| |_| (_)_ __ __ _ ___ "#); - println!(r#" | '__| | | / __| __| | | '_ \ / _` / __| "#); - println!(r#" | | | |_| \__ \ |_| | | | | | (_| \__ \ "#); - println!(r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "#); - println!(r#" |___/ "#); - println!(); + println!("\n{}\n", WELCOME); } if !Path::new("info.toml").exists() { @@ -139,8 +131,7 @@ fn main() { let verbose = args.nocapture; let command = args.nested.unwrap_or_else(|| { - let text = fs::read_to_string("default_out.txt").unwrap(); - println!("{}", text); + println!("{}\n", DEFAULT_OUT); std::process::exit(0); }); match command { @@ -229,35 +220,7 @@ fn main() { "{emoji} All exercises completed! {emoji}", emoji = Emoji("πŸŽ‰", "β˜…") ); - println!(); - println!("+----------------------------------------------------+"); - println!("| You made it to the Fe-nish line! |"); - println!("+-------------------------- ------------------------+"); - println!(" \\/ "); - println!(" β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ "); - println!(" β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ "); - println!(" β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ "); - println!(" β–‘β–‘β–’β–’β–’β–’β–‘β–‘β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–‘β–‘β–’β–’β–’β–’ "); - println!(" β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“ "); - println!(" β–’β–’β–’β–’ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’β–‘β–‘ β–’β–’β–’β–’ "); - println!(" β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’ "); - println!(" β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–“β–“β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–’β–’β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’ "); - println!(" β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ "); - println!(" β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ "); - println!(" β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ "); - println!(" β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ "); - println!(" β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ "); - println!(" β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ "); - println!(" β–’β–’ β–’β–’ β–’β–’ β–’β–’ "); - println!(); - println!("We hope you enjoyed learning about the various aspects of Rust!"); - println!( - "If you noticed any issues, please don't hesitate to report them to our repo." - ); - println!("You can also contribute your own exercises to help the greater community!"); - println!(); - println!("Before reporting an issue or contributing, please read our guidelines:"); - println!("https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md"); + println!("\n{}\n", FENISH_LINE); } } } @@ -356,3 +319,64 @@ fn rustc_exists() -> bool { .map(|status| status.success()) .unwrap_or(false) } + +const DEFAULT_OUT: &str = r#"Thanks for installing Rustlings! + +Is this your first time? Don't worry, Rustlings was made for beginners! We are +going to teach you a lot of things about Rust, but before we can get +started, here's a couple of notes about how Rustlings operates: + +1. The central concept behind Rustlings is that you solve exercises. These + exercises usually have some sort of syntax error in them, which will cause + them to fail compilation or testing. Sometimes there's a logic error instead + of a syntax error. No matter what error, it's your job to find it and fix it! + You'll know when you fixed it because then, the exercise will compile and + Rustlings will be able to move on to the next exercise. +2. If you run Rustlings in watch mode (which we recommend), it'll automatically + start with the first exercise. Don't get confused by an error message popping + up as soon as you run Rustlings! This is part of the exercise that you're + supposed to solve, so open the exercise file in an editor and start your + detective work! +3. If you're stuck on an exercise, there is a helpful hint you can view by typing + 'hint' (in watch mode), or running `rustlings hint exercise_name`. +4. If an exercise doesn't make sense to you, feel free to open an issue on GitHub! + (https://github.com/rust-lang/rustlings/issues/new). We look at every issue, + and sometimes, other learners do too so you can help each other out! + +Got all that? Great! To get started, run `rustlings watch` in order to get the first +exercise. Make sure to have your editor open!"#; + +const FENISH_LINE: &str = r#"+----------------------------------------------------+ +| You made it to the Fe-nish line! | ++-------------------------- ------------------------+ + \\/ + β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ + β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ + β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ + β–‘β–‘β–’β–’β–’β–’β–‘β–‘β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–‘β–‘β–’β–’β–’β–’ + β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“ + β–’β–’β–’β–’ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’β–‘β–‘ β–’β–’β–’β–’ + β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’ + β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–“β–“β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–’β–’β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’ + β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ + β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ + β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ + β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ + β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ + β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ + β–’β–’ β–’β–’ β–’β–’ β–’β–’ + +We hope you enjoyed learning about the various aspects of Rust! +If you noticed any issues, please don't hesitate to report them to our repo. +You can also contribute your own exercises to help the greater community! + +Before reporting an issue or contributing, please read our guidelines: +https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md"#; + +const WELCOME: &str = r#" welcome to... + _ _ _ + _ __ _ _ ___| |_| (_)_ __ __ _ ___ + | '__| | | / __| __| | | '_ \ / _` / __| + | | | |_| \__ \ |_| | | | | | (_| \__ \ + |_| \__,_|___/\__|_|_|_| |_|\__, |___/ + |___/"#; From 359f81dd0bf5cc82016c56d374b38bf4de8f5893 Mon Sep 17 00:00:00 2001 From: ana Date: Fri, 29 Oct 2021 14:27:36 +0200 Subject: [PATCH 05/92] chore: upgrade edition to 2021 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3b2a85a7..30032695 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "rustlings" version = "4.6.0" authors = ["anastasie ", "Carol (Nichols || Goulding) "] -edition = "2018" +edition = "2021" [dependencies] argh = "0.1.4" From d1ee2daf14f19105e6db3f9c610f44293d688532 Mon Sep 17 00:00:00 2001 From: Michael Walsh <48160144+MpdWalsh@users.noreply.github.com> Date: Sat, 30 Oct 2021 16:55:58 -0600 Subject: [PATCH 06/92] fix(structs3.rs): assigned value to cents_per_gram in test Intended to simplify the lesson by removing the need to figure out what the value is meant to be based on the tests. Previous commits (https://github.com/rust-lang/rustlings/commit/9ca08b8f2b09366e97896a4a8cf9ff3bb4d54380 and https://github.com/rust-lang/rustlings/commit/114b54cbdb977234b39e5f180d937c14c78bb8b2#diff-ce1c232ff0ddaff909351bb84cb5bff423b5b9e04f21fd4db7ffe443e598e174) removed the mathematical complexity, and I feel this addition is a needed change to further streamline the exercise. --- exercises/structs/structs3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/structs/structs3.rs b/exercises/structs/structs3.rs index b3aa2825..1a81531c 100644 --- a/exercises/structs/structs3.rs +++ b/exercises/structs/structs3.rs @@ -73,7 +73,7 @@ mod tests { let sender_country = String::from("Spain"); let recipient_country = String::from("Spain"); - let cents_per_gram = ???; + let cents_per_gram = 3; let package = Package::new(sender_country, recipient_country, 1500); From e08b6cf3ef157dd7dc65b920b36723a4c480179c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 31 Oct 2021 16:25:35 +0000 Subject: [PATCH 07/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3ef758d..c0ba6ce9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-111-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-112-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -315,6 +315,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Zhenghao Lu

πŸ–‹
Fredrik Enestad

πŸ–‹
xuesong

πŸ–‹ +
Michael Walsh

πŸ’» From cb661896a21aa00d46b894cdc4a7632f7569479c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 31 Oct 2021 16:25:36 +0000 Subject: [PATCH 08/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d7c7d465..cda03778 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1029,6 +1029,15 @@ "contributions": [ "content" ] + }, + { + "login": "MpdWalsh", + "name": "Michael Walsh", + "avatar_url": "https://avatars.githubusercontent.com/u/48160144?v=4", + "profile": "https://github.com/MpdWalsh", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 8ef4869b264094e5a9b50452b4534823a9df19c3 Mon Sep 17 00:00:00 2001 From: alirezaghey Date: Wed, 15 Dec 2021 10:44:21 +0100 Subject: [PATCH 09/92] fix(functions5): Remove wrong new line and small English improvements (#885) --- info.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/info.toml b/info.toml index 5eece6d7..95850c63 100644 --- a/info.toml +++ b/info.toml @@ -114,8 +114,7 @@ path = "exercises/functions/functions5.rs" mode = "compile" hint = """ This is a really common error that can be fixed by removing one character. -It happens because Rust distinguishes between expressions and statements: expressions return -a value based on its operand, and statements simply return a () type which behaves just like `void` in C/C++ language. +It happens because Rust distinguishes between expressions and statements: expressions return a value based on their operand(s), and statements simply return a () type which behaves just like `void` in C/C++ language. We want to return a value of `i32` type from the `square` function, but it is returning a `()` type... They are not the same. There are two solutions: 1. Add a `return` ahead of `num * num;` From 72b2c9f54f5f4d246616af767a1a842223702a13 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 15 Dec 2021 09:44:38 +0000 Subject: [PATCH 10/92] docs: update README.md [skip ci] --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0ba6ce9..7595a9eb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-112-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-113-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -317,6 +317,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
xuesong

πŸ–‹
Michael Walsh

πŸ’» + +
alirezaghey

πŸ–‹ + From 527a5b1182483aa467556c1a36d9322440befa43 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 15 Dec 2021 09:44:39 +0000 Subject: [PATCH 11/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index cda03778..6bf3853e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1038,6 +1038,15 @@ "contributions": [ "code" ] + }, + { + "login": "alirezaghey", + "name": "alirezaghey", + "avatar_url": "https://avatars.githubusercontent.com/u/26653424?v=4", + "profile": "https://github.com/alirezaghey", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From f2650de369810867d2763e935ac0963c32ec420e Mon Sep 17 00:00:00 2001 From: Franklin van Nes Date: Wed, 15 Dec 2021 11:46:27 -0500 Subject: [PATCH 12/92] fix(clippy1): Updated code to test correctness clippy lint with approx_constant lint rule closes #888 --- exercises/clippy/clippy1.rs | 16 +++++++++++----- info.toml | 16 ++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/exercises/clippy/clippy1.rs b/exercises/clippy/clippy1.rs index bdb5dd2c..c5f84a9c 100644 --- a/exercises/clippy/clippy1.rs +++ b/exercises/clippy/clippy1.rs @@ -8,10 +8,16 @@ // I AM NOT DONE +use std::f32; + fn main() { - let x = 1.2331f64; - let y = 1.2332f64; - if y != x { - println!("Success!"); - } + let pi = 3.14f32; + let radius = 5.00f32; + + let area = pi * f32::powi(radius, 2); + + println!( + "The area of a circle with radius {:.2} is {:.5}!", + radius, area + ) } diff --git a/info.toml b/info.toml index 95850c63..0c03def3 100644 --- a/info.toml +++ b/info.toml @@ -906,15 +906,15 @@ name = "clippy1" path = "exercises/clippy/clippy1.rs" mode = "clippy" hint = """ -Not every floating point value can be represented exactly in binary values in -memory. Take a look at the description of -https://doc.rust-lang.org/stable/std/primitive.f32.html -When using the binary compare operators with floating points you won't compare -the floating point values but the binary representation in memory. This is -usually not what you would like to do. +Rust stores the highest precision version of any long or inifinite precision +mathematical constants in the rust standard library. +https://doc.rust-lang.org/stable/std/f32/consts/index.html + +We may be tempted to use our own approximations for certain mathematical constants, +but clippy recognizes those imprecise mathematical constants as a source of +potential error. See the suggestions of the clippy warning in compile output and use the -machine epsilon value... -https://doc.rust-lang.org/stable/std/primitive.f32.html#associatedconstant.EPSILON""" +appropriate replacement constant from std::f32::consts...""" [[exercises]] name = "clippy2" From 8d675198d81eedb02ef3124321670000f0f6fd6c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:11:14 +0000 Subject: [PATCH 13/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7595a9eb..469e1ef0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-113-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-114-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -319,6 +319,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
alirezaghey

πŸ–‹ +
Franklin van Nes

πŸ’» From 81fb3967805a939f1149f0451afd94d566ab4d2a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:11:15 +0000 Subject: [PATCH 14/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6bf3853e..f04a0ce2 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1047,6 +1047,15 @@ "contributions": [ "content" ] + }, + { + "login": "frvannes16", + "name": "Franklin van Nes", + "avatar_url": "https://avatars.githubusercontent.com/u/3188475?v=4", + "profile": "https://github.com/frvannes16", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 9b27e8d993ca20232fe38a412750c3f845a83b65 Mon Sep 17 00:00:00 2001 From: Galih wisnuaji Date: Fri, 24 Dec 2021 13:48:43 +0700 Subject: [PATCH 15/92] chore : replace filter_map() with find_map() --- src/exercise.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/exercise.rs b/src/exercise.rs index ec694df9..e4a4145d 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -217,8 +217,7 @@ path = "{}.rs""#, let matched_line_index = source .lines() .enumerate() - .filter_map(|(i, line)| if re.is_match(line) { Some(i) } else { None }) - .next() + .find_map(|(i, line)| if re.is_match(line) { Some(i) } else { None }) .expect("This should not happen at all"); let min_line = ((matched_line_index as i32) - (CONTEXT as i32)).max(0) as usize; From f61f9f379638c0142f759ece850c768807a8abfd Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 24 Dec 2021 12:28:07 +0000 Subject: [PATCH 16/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 469e1ef0..1a878ef4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-114-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-115-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -320,6 +320,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
alirezaghey

πŸ–‹
Franklin van Nes

πŸ’» +
nekonako

πŸ’» From 7dce8c8b612a68ccfc1165358e075c4837b0bf92 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 24 Dec 2021 12:28:08 +0000 Subject: [PATCH 17/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index f04a0ce2..6c3319ca 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1056,6 +1056,15 @@ "contributions": [ "code" ] + }, + { + "login": "nekonako", + "name": "nekonako", + "avatar_url": "https://avatars.githubusercontent.com/u/46141275?v=4", + "profile": "https://nekonako.github.io", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 1622e8c198d89739765c915203efff0091bdeb78 Mon Sep 17 00:00:00 2001 From: ZX <67887489+tan-zx@users.noreply.github.com> Date: Wed, 29 Dec 2021 14:55:37 +0800 Subject: [PATCH 18/92] fix(quiz1): update to say quiz covers "If" --- exercises/quiz1.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index b13b9284..7bd3f589 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -2,6 +2,7 @@ // This is a quiz for the following sections: // - Variables // - Functions +// - If // Mary is buying apples. One apple usually costs 2 Rustbucks, but if you buy // more than 40 at once, each apple only costs 1! Write a function that calculates From af84359bdb49282dbd26a72cb67d25a3823290db Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 11:59:05 +0000 Subject: [PATCH 19/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a878ef4..6fe96b57 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-115-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-116-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -321,6 +321,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
alirezaghey

πŸ–‹
Franklin van Nes

πŸ’»
nekonako

πŸ’» +
ZX

πŸ–‹ From 17e3e75331ea508efddd9a7d507bf76a16fd9a24 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 11:59:06 +0000 Subject: [PATCH 20/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6c3319ca..91b2a486 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1065,6 +1065,15 @@ "contributions": [ "code" ] + }, + { + "login": "tan-zx", + "name": "ZX", + "avatar_url": "https://avatars.githubusercontent.com/u/67887489?v=4", + "profile": "https://github.com/tan-zx", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 71a06044e6a96ff756dc31d7b0ed665ae4badb57 Mon Sep 17 00:00:00 2001 From: radicale Date: Fri, 4 Feb 2022 14:39:09 +0100 Subject: [PATCH 21/92] fix(clippy1): Set clippy::float_cmp lint to deny (#907) --- src/exercise.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exercise.rs b/src/exercise.rs index e4a4145d..6e49a9aa 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -154,7 +154,7 @@ path = "{}.rs""#, Command::new("cargo") .args(&["clippy", "--manifest-path", CLIPPY_CARGO_TOML_PATH]) .args(RUSTC_COLOR_ARGS) - .args(&["--", "-D", "warnings"]) + .args(&["--", "-D", "warnings","-D","clippy::float_cmp"]) .output() } } From cbcde345409c3e550112e449242848eaa3391bb6 Mon Sep 17 00:00:00 2001 From: zydxhs Date: Fri, 4 Feb 2022 22:00:24 +0800 Subject: [PATCH 22/92] fix(errors1): Add a comment to make the purpose more clear (#486) Signed-off-by: zydxhs --- exercises/error_handling/errors1.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/error_handling/errors1.rs b/exercises/error_handling/errors1.rs index 9c24d85d..5844a497 100644 --- a/exercises/error_handling/errors1.rs +++ b/exercises/error_handling/errors1.rs @@ -36,6 +36,7 @@ mod tests { fn explains_why_generating_nametag_text_fails() { assert_eq!( generate_nametag_text("".into()), + // Don't change this line Err("`name` was empty; it must be nonempty.".into()) ); } From 4f7ff5d9c7b2d8b045194c1a9469d37e30257c4a Mon Sep 17 00:00:00 2001 From: Yang Wen Date: Fri, 4 Feb 2022 22:12:02 +0800 Subject: [PATCH 23/92] fix(structs3): Add a hint for panic (#608) as a totally newbie to Rust, I don't know panic statement from https://doc.rust-lang.org/book/ and rustlings in the beginning. After a hard searching of [should_panic], then I figure out panic statement. So it's helpful to tell the learner that write a panic statement here. --- exercises/structs/structs3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/structs/structs3.rs b/exercises/structs/structs3.rs index 1a81531c..e84f2ebc 100644 --- a/exercises/structs/structs3.rs +++ b/exercises/structs/structs3.rs @@ -16,7 +16,7 @@ struct Package { impl Package { fn new(sender_country: String, recipient_country: String, weight_in_grams: i32) -> Package { if weight_in_grams <= 0 { - // Something goes here... + // panic statement goes here... } else { Package { sender_country, From 52c7f8a85901b6714c732d2107823750de0d452f Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:13:31 +0000 Subject: [PATCH 24/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fe96b57..b4f6a7ee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-116-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-117-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -322,6 +322,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Franklin van Nes

πŸ’»
nekonako

πŸ’»
ZX

πŸ–‹ +
Yang Wen

πŸ–‹ From a2e74a2a4bebdd48e9c4336c08c02222e36e2e6d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:13:32 +0000 Subject: [PATCH 25/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 91b2a486..3f246446 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1074,6 +1074,15 @@ "contributions": [ "content" ] + }, + { + "login": "sundevilyang", + "name": "Yang Wen", + "avatar_url": "https://avatars.githubusercontent.com/u/1499214?v=4", + "profile": "https://github.com/sundevilyang", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From bc5686174463ad6f4f6b824b0e9b97c3039d4886 Mon Sep 17 00:00:00 2001 From: Brandon High Date: Fri, 4 Feb 2022 06:38:55 -0800 Subject: [PATCH 26/92] doc: Add hints on how to get gcc installed (#741) --- README.md | 1 + install.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index b4f6a7ee..835200e8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Alternatively, for a first-time Rust learner, there are several other resources: ## Getting Started _Note: If you're on MacOS, make sure you've installed Xcode and its developer tools by typing `xcode-select --install`._ +_Note: If you're on Linux, make sure you've installed gcc. Deb: `sudo apt install gcc`. Yum: `sudo yum -y install gcc`._ You will need to have Rust installed. You can get it by visiting https://rustup.rs. This'll also install Cargo, Rust's package/project manager. diff --git a/install.sh b/install.sh index e986e741..68b8da3a 100755 --- a/install.sh +++ b/install.sh @@ -12,6 +12,18 @@ else exit 1 fi +if [ -x "$(command -v cc)" ] +then + echo "SUCCESS: cc is installed" +else + echo "ERROR: cc does not seem to be installed." + echo "Please download (g)cc using your package manager." + echo "OSX: xcode-select --install" + echo "Deb: sudo apt install gcc" + echo "Yum: sudo yum -y install gcc" + exit 1 +fi + if [ -x "$(command -v rustc)" ] then echo "SUCCESS: Rust is installed" From e96112ab998f6b121b2ea7ddf27d9e99e37dba0f Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:39:42 +0000 Subject: [PATCH 27/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 835200e8..c9bb8b87 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-117-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-118-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -324,6 +324,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
nekonako

πŸ’»
ZX

πŸ–‹
Yang Wen

πŸ–‹ +
Brandon High

πŸ“– From dc36ca6d84e66e1304f662770d560b3fcde7c35d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 4 Feb 2022 14:39:43 +0000 Subject: [PATCH 28/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 3f246446..8207a035 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1083,6 +1083,15 @@ "contributions": [ "content" ] + }, + { + "login": "highb", + "name": "Brandon High", + "avatar_url": "https://avatars.githubusercontent.com/u/759848?v=4", + "profile": "https://brandon-high.com", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 8, From 9be012dda0617e868c044a22e815933bc0db2cb0 Mon Sep 17 00:00:00 2001 From: Ryan Lowe Date: Sat, 5 Feb 2022 16:54:11 -0500 Subject: [PATCH 29/92] feat!: Add progress indicator closes #360 BREAKING CHANGE: verify() has a new function signature so it can know the current completion progress --- src/main.rs | 13 ++++++------- src/verify.rs | 25 ++++++++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 32e7bba2..96378ece 100644 --- a/src/main.rs +++ b/src/main.rs @@ -214,7 +214,7 @@ fn main() { } Subcommands::Verify(_subargs) => { - verify(&exercises, verbose).unwrap_or_else(|_| std::process::exit(1)); + verify(&exercises, (0, exercises.len()), verbose).unwrap_or_else(|_| std::process::exit(1)); } Subcommands::Watch(_subargs) => match watch(&exercises, verbose) { @@ -351,7 +351,7 @@ fn watch(exercises: &[Exercise], verbose: bool) -> notify::Result { clear_screen(); let to_owned_hint = |t: &Exercise| t.hint.to_owned(); - let failed_exercise_hint = match verify(exercises.iter(), verbose) { + let failed_exercise_hint = match verify(exercises.iter(), (0, exercises.len()), verbose) { Ok(_) => return Ok(WatchStatus::Finished), Err(exercise) => Arc::new(Mutex::new(Some(to_owned_hint(exercise)))), }; @@ -362,17 +362,16 @@ fn watch(exercises: &[Exercise], verbose: bool) -> notify::Result { DebouncedEvent::Create(b) | DebouncedEvent::Chmod(b) | DebouncedEvent::Write(b) => { if b.extension() == Some(OsStr::new("rs")) && b.exists() { let filepath = b.as_path().canonicalize().unwrap(); - let pending_exercises = exercises - .iter() - .skip_while(|e| !filepath.ends_with(&e.path)) - // .filter(|e| filepath.ends_with(&e.path)) + let pending_exercises = exercises.iter() + .find(|e| filepath.ends_with(&e.path)).into_iter() .chain( exercises .iter() .filter(|e| !e.looks_done() && !filepath.ends_with(&e.path)), ); + let num_done = exercises.iter().filter(|e| e.looks_done()).count(); clear_screen(); - match verify(pending_exercises, verbose) { + match verify(pending_exercises, (num_done, exercises.len()), verbose) { Ok(_) => return Ok(WatchStatus::Finished), Err(exercise) => { let mut failed_exercise_hint = failed_exercise_hint.lock().unwrap(); diff --git a/src/verify.rs b/src/verify.rs index fd59fa51..eb7af69f 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -1,6 +1,6 @@ use crate::exercise::{CompiledExercise, Exercise, Mode, State}; use console::style; -use indicatif::ProgressBar; +use indicatif::{ProgressBar, ProgressStyle}; use std::env; // Verify that the provided container of Exercise objects @@ -9,10 +9,18 @@ use std::env; // If the Exercise being verified is a test, the verbose boolean // determines whether or not the test harness outputs are displayed. pub fn verify<'a>( - start_at: impl IntoIterator, + exercises: impl IntoIterator, + progress: (usize, usize), verbose: bool, ) -> Result<(), &'a Exercise> { - for exercise in start_at { + let (num_done, total) = progress; + let bar = ProgressBar::new(total as u64); + bar.set_style(ProgressStyle::default_bar() + .template("Progress: [{bar:60.green/red}] {pos}/{len}") + .progress_chars("#>-") + ); + bar.set_position(num_done as u64); + for exercise in exercises { let compile_result = match exercise.mode { Mode::Test => compile_and_test(exercise, RunMode::Interactive, verbose), Mode::Compile => compile_and_run_interactively(exercise), @@ -21,6 +29,7 @@ pub fn verify<'a>( if !compile_result.unwrap_or(false) { return Err(exercise); } + bar.inc(1); } Ok(()) } @@ -45,7 +54,6 @@ fn compile_only(exercise: &Exercise) -> Result { let _ = compile(exercise, &progress_bar)?; progress_bar.finish_and_clear(); - success!("Successfully compiled {}!", exercise); Ok(prompt_for_completion(exercise, None)) } @@ -71,8 +79,6 @@ fn compile_and_run_interactively(exercise: &Exercise) -> Result { } }; - success!("Successfully ran {}!", exercise); - Ok(prompt_for_completion(exercise, Some(output.stdout))) } @@ -92,7 +98,6 @@ fn compile_and_test(exercise: &Exercise, run_mode: RunMode, verbose: bool) -> Re if verbose { println!("{}", output.stdout); } - success!("Successfully tested {}", &exercise); if let RunMode::Interactive = run_mode { Ok(prompt_for_completion(exercise, None)) } else { @@ -138,6 +143,12 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option) -> State::Pending(context) => context, }; + match exercise.mode { + Mode::Compile => success!("Successfully ran {}!", exercise), + Mode::Test => success!("Successfully tested {}!", exercise), + Mode::Clippy => success!("Successfully compiled {}!", exercise), + } + let no_emoji = env::var("NO_EMOJI").is_ok(); let clippy_success_msg = if no_emoji { From 17f9d7429ccd133a72e815fb5618e0ce79560929 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Mon, 28 Mar 2022 10:10:25 +0900 Subject: [PATCH 30/92] docs: fix some code-blocks were not highlighted --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c9bb8b87..11e0438a 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,13 @@ This will install Rustlings and give you access to the `rustlings` command. Run In PowerShell (Run as Administrator), set `ExecutionPolicy` to `RemoteSigned`: -```ps +```ps1 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser ``` Then, you can run: -```ps +```ps1 Start-BitsTransfer -Source https://git.io/JTL5v -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1 ``` From 179a75a68d03ac9518dec2297fb17f91a4fc506b Mon Sep 17 00:00:00 2001 From: x-hgg-x <39058530+x-hgg-x@users.noreply.github.com> Date: Tue, 29 Mar 2022 11:44:06 +0200 Subject: [PATCH 31/92] fix: Include exercises folder in the project structure behind a feature (#917) closes #859 closes #913 closes #942 --- Cargo.toml | 5 ++++- exercises/advanced_errors/mod.rs | 2 ++ exercises/clippy/mod.rs | 2 ++ exercises/collections/mod.rs | 4 ++++ exercises/conversions/mod.rs | 5 +++++ exercises/enums/mod.rs | 3 +++ exercises/error_handling/mod.rs | 6 ++++++ exercises/functions/mod.rs | 5 +++++ exercises/generics/mod.rs | 3 +++ exercises/if/mod.rs | 2 ++ exercises/intro/mod.rs | 2 ++ exercises/macros/mod.rs | 4 ++++ exercises/mod.rs | 26 +++++++++++++++++++++++++ exercises/modules/mod.rs | 3 +++ exercises/move_semantics/mod.rs | 5 +++++ exercises/option/mod.rs | 3 +++ exercises/primitive_types/mod.rs | 6 ++++++ exercises/standard_library_types/mod.rs | 7 +++++++ exercises/strings/mod.rs | 2 ++ exercises/structs/mod.rs | 3 +++ exercises/tests/mod.rs | 3 +++ exercises/threads/mod.rs | 1 + exercises/traits/mod.rs | 2 ++ exercises/variables/mod.rs | 6 ++++++ src/lib.rs | 3 +++ 25 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 exercises/advanced_errors/mod.rs create mode 100644 exercises/clippy/mod.rs create mode 100644 exercises/collections/mod.rs create mode 100644 exercises/conversions/mod.rs create mode 100644 exercises/enums/mod.rs create mode 100644 exercises/error_handling/mod.rs create mode 100644 exercises/functions/mod.rs create mode 100644 exercises/generics/mod.rs create mode 100644 exercises/if/mod.rs create mode 100644 exercises/intro/mod.rs create mode 100644 exercises/macros/mod.rs create mode 100644 exercises/mod.rs create mode 100644 exercises/modules/mod.rs create mode 100644 exercises/move_semantics/mod.rs create mode 100644 exercises/option/mod.rs create mode 100644 exercises/primitive_types/mod.rs create mode 100644 exercises/standard_library_types/mod.rs create mode 100644 exercises/strings/mod.rs create mode 100644 exercises/structs/mod.rs create mode 100644 exercises/tests/mod.rs create mode 100644 exercises/threads/mod.rs create mode 100644 exercises/traits/mod.rs create mode 100644 exercises/variables/mod.rs create mode 100644 src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 30032695..4761c9a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ console = "0.7.7" notify = "4.0.15" toml = "0.4.10" regex = "1.1.6" -serde = {version = "1.0.10", features = ["derive"]} +serde = { version = "1.0.10", features = ["derive"] } [[bin]] name = "rustlings" @@ -21,3 +21,6 @@ path = "src/main.rs" assert_cmd = "0.11.0" predicates = "1.0.1" glob = "0.3.0" + +[features] +exercises = [] diff --git a/exercises/advanced_errors/mod.rs b/exercises/advanced_errors/mod.rs new file mode 100644 index 00000000..e33fb80d --- /dev/null +++ b/exercises/advanced_errors/mod.rs @@ -0,0 +1,2 @@ +mod advanced_errs1; +mod advanced_errs2; diff --git a/exercises/clippy/mod.rs b/exercises/clippy/mod.rs new file mode 100644 index 00000000..689dc95f --- /dev/null +++ b/exercises/clippy/mod.rs @@ -0,0 +1,2 @@ +mod clippy1; +mod clippy2; diff --git a/exercises/collections/mod.rs b/exercises/collections/mod.rs new file mode 100644 index 00000000..f46c1424 --- /dev/null +++ b/exercises/collections/mod.rs @@ -0,0 +1,4 @@ +mod hashmap1; +mod hashmap2; +mod vec1; +mod vec2; diff --git a/exercises/conversions/mod.rs b/exercises/conversions/mod.rs new file mode 100644 index 00000000..69f66ae4 --- /dev/null +++ b/exercises/conversions/mod.rs @@ -0,0 +1,5 @@ +mod as_ref_mut; +mod from_into; +mod from_str; +mod try_from_into; +mod using_as; diff --git a/exercises/enums/mod.rs b/exercises/enums/mod.rs new file mode 100644 index 00000000..a23fd6e5 --- /dev/null +++ b/exercises/enums/mod.rs @@ -0,0 +1,3 @@ +mod enums1; +mod enums2; +mod enums3; diff --git a/exercises/error_handling/mod.rs b/exercises/error_handling/mod.rs new file mode 100644 index 00000000..539fa23d --- /dev/null +++ b/exercises/error_handling/mod.rs @@ -0,0 +1,6 @@ +mod errors1; +mod errors2; +mod errors3; +mod errors4; +mod errors5; +mod errors6; diff --git a/exercises/functions/mod.rs b/exercises/functions/mod.rs new file mode 100644 index 00000000..445b6f58 --- /dev/null +++ b/exercises/functions/mod.rs @@ -0,0 +1,5 @@ +mod functions1; +mod functions2; +mod functions3; +mod functions4; +mod functions5; diff --git a/exercises/generics/mod.rs b/exercises/generics/mod.rs new file mode 100644 index 00000000..5b93555c --- /dev/null +++ b/exercises/generics/mod.rs @@ -0,0 +1,3 @@ +mod generics1; +mod generics2; +mod generics3; diff --git a/exercises/if/mod.rs b/exercises/if/mod.rs new file mode 100644 index 00000000..c5d02445 --- /dev/null +++ b/exercises/if/mod.rs @@ -0,0 +1,2 @@ +mod if1; +mod if2; diff --git a/exercises/intro/mod.rs b/exercises/intro/mod.rs new file mode 100644 index 00000000..445c47ab --- /dev/null +++ b/exercises/intro/mod.rs @@ -0,0 +1,2 @@ +mod intro1; +mod intro2; diff --git a/exercises/macros/mod.rs b/exercises/macros/mod.rs new file mode 100644 index 00000000..9f65acf5 --- /dev/null +++ b/exercises/macros/mod.rs @@ -0,0 +1,4 @@ +mod macros1; +mod macros2; +mod macros3; +mod macros4; diff --git a/exercises/mod.rs b/exercises/mod.rs new file mode 100644 index 00000000..6a143b56 --- /dev/null +++ b/exercises/mod.rs @@ -0,0 +1,26 @@ +mod advanced_errors; +mod clippy; +mod collections; +mod conversions; +mod enums; +mod error_handling; +mod functions; +mod generics; +mod r#if; +mod intro; +mod macros; +mod modules; +mod move_semantics; +mod option; +mod primitive_types; +mod quiz1; +mod quiz2; +mod quiz3; +mod quiz4; +mod standard_library_types; +mod strings; +mod structs; +mod tests; +mod threads; +mod traits; +mod variables; diff --git a/exercises/modules/mod.rs b/exercises/modules/mod.rs new file mode 100644 index 00000000..35f96af5 --- /dev/null +++ b/exercises/modules/mod.rs @@ -0,0 +1,3 @@ +mod modules1; +mod modules2; +mod modules3; diff --git a/exercises/move_semantics/mod.rs b/exercises/move_semantics/mod.rs new file mode 100644 index 00000000..c9e61b36 --- /dev/null +++ b/exercises/move_semantics/mod.rs @@ -0,0 +1,5 @@ +mod move_semantics1; +mod move_semantics2; +mod move_semantics3; +mod move_semantics4; +mod move_semantics5; diff --git a/exercises/option/mod.rs b/exercises/option/mod.rs new file mode 100644 index 00000000..b3cdb13d --- /dev/null +++ b/exercises/option/mod.rs @@ -0,0 +1,3 @@ +mod option1; +mod option2; +mod option3; diff --git a/exercises/primitive_types/mod.rs b/exercises/primitive_types/mod.rs new file mode 100644 index 00000000..23355239 --- /dev/null +++ b/exercises/primitive_types/mod.rs @@ -0,0 +1,6 @@ +mod primitive_types1; +mod primitive_types2; +mod primitive_types3; +mod primitive_types4; +mod primitive_types5; +mod primitive_types6; diff --git a/exercises/standard_library_types/mod.rs b/exercises/standard_library_types/mod.rs new file mode 100644 index 00000000..b03acb92 --- /dev/null +++ b/exercises/standard_library_types/mod.rs @@ -0,0 +1,7 @@ +mod arc1; +mod box1; +mod iterators1; +mod iterators2; +mod iterators3; +mod iterators4; +mod iterators5; diff --git a/exercises/strings/mod.rs b/exercises/strings/mod.rs new file mode 100644 index 00000000..b1b460bc --- /dev/null +++ b/exercises/strings/mod.rs @@ -0,0 +1,2 @@ +mod strings1; +mod strings2; diff --git a/exercises/structs/mod.rs b/exercises/structs/mod.rs new file mode 100644 index 00000000..214fed16 --- /dev/null +++ b/exercises/structs/mod.rs @@ -0,0 +1,3 @@ +mod structs1; +mod structs2; +mod structs3; diff --git a/exercises/tests/mod.rs b/exercises/tests/mod.rs new file mode 100644 index 00000000..489541be --- /dev/null +++ b/exercises/tests/mod.rs @@ -0,0 +1,3 @@ +mod tests1; +mod tests2; +mod tests3; diff --git a/exercises/threads/mod.rs b/exercises/threads/mod.rs new file mode 100644 index 00000000..24d54007 --- /dev/null +++ b/exercises/threads/mod.rs @@ -0,0 +1 @@ +mod threads1; diff --git a/exercises/traits/mod.rs b/exercises/traits/mod.rs new file mode 100644 index 00000000..6f0a9c3f --- /dev/null +++ b/exercises/traits/mod.rs @@ -0,0 +1,2 @@ +mod traits1; +mod traits2; diff --git a/exercises/variables/mod.rs b/exercises/variables/mod.rs new file mode 100644 index 00000000..a25f477e --- /dev/null +++ b/exercises/variables/mod.rs @@ -0,0 +1,6 @@ +mod variables1; +mod variables2; +mod variables3; +mod variables4; +mod variables5; +mod variables6; diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..82c1e7e4 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,3 @@ +#[cfg(feature = "exercises")] +#[path = "../exercises/mod.rs"] +mod exercises; From 4378d1db461843d8fb93e0a8649d1c05dcb3032e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 09:47:50 +0000 Subject: [PATCH 32/92] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c9bb8b87..92a5095e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-118-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-119-orange.svg?style=flat-square)](#contributors-) # rustlings πŸ¦€β€οΈ @@ -325,6 +325,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
ZX

πŸ–‹
Yang Wen

πŸ–‹
Brandon High

πŸ“– +
x-hgg-x

πŸ’» From 0232f6058f7d6252378f6082a46ad2f4e7885d36 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 09:47:51 +0000 Subject: [PATCH 33/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8207a035..fc94bb1d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1092,6 +1092,15 @@ "contributions": [ "doc" ] + }, + { + "login": "x-hgg-x", + "name": "x-hgg-x", + "avatar_url": "https://avatars.githubusercontent.com/u/39058530?v=4", + "profile": "https://github.com/x-hgg-x", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 057d912e78dc1f465b671be4f290db49331d0701 Mon Sep 17 00:00:00 2001 From: mokou Date: Tue, 29 Mar 2022 11:49:36 +0200 Subject: [PATCH 34/92] chore: push contributors to AUTHORS.md the readme file is getting a bit crowded at this point, it's better to have a reference to AUTHORS.md, and then to let the bot add it in there --- .all-contributorsrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index fc94bb1d..b18300b9 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { "files": [ - "README.md" + "AUTHORS.md" ], "imageSize": 100, "commit": false, From bf93724511e672fb1dd124cb76da74f9f2af421b Mon Sep 17 00:00:00 2001 From: mokou Date: Tue, 29 Mar 2022 11:52:06 +0200 Subject: [PATCH 35/92] chore: add empty authors file --- AUTHORS.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 AUTHORS.md diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..6d309389 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,6 @@ +## Authors + +This file lists the people that have contributed to this project. + +Excluded from this list are @carols10cents and @diannasoreil, the principal +authors. From c60bd97cb94b234a3e17d8cc043f441eca3c073e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:54:21 +0000 Subject: [PATCH 36/92] docs: update AUTHORS.md [skip ci] From 70e29d9717a1f4fdb1bdd1a52e4c4d8211262579 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:54:22 +0000 Subject: [PATCH 37/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b18300b9..c07ac794 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1101,6 +1101,15 @@ "contributions": [ "code" ] + }, + { + "login": "KisaragiEffective", + "name": "Kisaragi", + "avatar_url": "https://avatars.githubusercontent.com/u/48310258?v=4", + "profile": "http://kisaragieffective.github.io", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 8, From 01023f5b4f461ed6819b7c3192164cee36d73b2d Mon Sep 17 00:00:00 2001 From: mokou Date: Tue, 29 Mar 2022 14:58:52 +0200 Subject: [PATCH 38/92] chore: copy existing contributors table --- AUTHORS.md | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 6d309389..9813bd17 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,3 +4,165 @@ This file lists the people that have contributed to this project. Excluded from this list are @carols10cents and @diannasoreil, the principal authors. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Carol (Nichols || Goulding)

πŸ’» πŸ–‹

QuietMisdreavus

πŸ’» πŸ–‹

Robert M Lugg

πŸ–‹

Hynek Schlawack

πŸ’»

Katharina Fey

πŸ’»

lukabavdaz

πŸ’» πŸ–‹

Erik Vesteraas

πŸ’»

delet0r

πŸ’»

Shaun Bennett

πŸ’»

Andrew Bagshaw

πŸ’»

Kyle Isom

πŸ’»

Colin Pitrat

πŸ’»

Zac Anger

πŸ’»

Matthias Geier

πŸ’»

Chris Pearce

πŸ’»

Yvan Sraka

πŸ’»

Denys Smirnov

πŸ’»

eddyp

πŸ’»

Brian Kung

πŸ’» πŸ–‹

Russell

πŸ’»

Dan Wilhelm

πŸ“–

Jesse

πŸ’» πŸ–‹

Fredrik JambrΓ©n

πŸ’»

Pete McFarlane

πŸ–‹

nkanderson

πŸ’» πŸ–‹

Ajax M

πŸ“–

Dylan Nugent

πŸ–‹

vyaslav

πŸ’» πŸ–‹

George

πŸ’»

Thomas Holloway

πŸ’» πŸ–‹

Jubilee

πŸ’»

WofWca

πŸ’»

Roberto Vidal

πŸ’» πŸ“– πŸ€” 🚧

Jens

πŸ“–

Rahat Ahmed

πŸ“–

Abdou Seck

πŸ’» πŸ–‹ πŸ‘€

Katie

πŸ’»

Socrates

πŸ“–

gnodarse

πŸ–‹

Harrison Metzger

πŸ’»

Torben Jonas

πŸ’» πŸ–‹

Paul Bissex

πŸ“–

Steven Mann

πŸ’» πŸ–‹

Mario Reder

πŸ’» πŸ–‹

skim

πŸ’»

Sanjay K

πŸ’» πŸ–‹

Rohan Jain

πŸ’»

Said Aspen

πŸ’» πŸ–‹

Ufuk Celebi

πŸ’»

lebedevsergey

πŸ“–

Aleksei Trifonov

πŸ–‹

Darren Meehan

πŸ–‹

Jihchi Lee

πŸ–‹

Christofer Bertonha

πŸ–‹

Vivek Bharath Akupatni

πŸ’» ⚠️

DΓ­dac SementΓ© FernΓ‘ndez

πŸ’» πŸ–‹

Rob Story

πŸ’»

Siobhan Jacobson

πŸ’»

Evan Carroll

πŸ–‹

Jawaad Mahmood

πŸ–‹

Gaurang Tandon

πŸ–‹

Stefan Kupresak

πŸ–‹

Greg Leonard

πŸ–‹

Ryan McQuen

πŸ’»

Annika

πŸ‘€

Axel Viala

πŸ’»

Mohammed Sazid Al Rashid

πŸ–‹ πŸ’»

Caleb Webber

🚧

Peter N

🚧

seancad

🚧

Will Hayworth

πŸ–‹

Christian Zeller

πŸ–‹

Jean-Francois Chevrette

πŸ–‹ πŸ’»

John Baber-Lucero

πŸ–‹

Tal

πŸ–‹

apogeeoak

πŸ–‹ πŸ’»

Larry Garfield

πŸ–‹

circumspect

πŸ–‹

Cyrus Wyett

πŸ–‹

cadolphs

πŸ’»

Pascal H.

πŸ–‹

Rod Elias

πŸ–‹

Matt Lebl

πŸ’»

Ignacio Le Fluk

πŸ–‹

Taylor Yu

πŸ’» πŸ–‹

Patrick Hintermayer

πŸ’»

Pete Pavlovski

πŸ–‹

k12ish

πŸ–‹

Shao Yang Hong

πŸ–‹

Brandon Macer

πŸ–‹

Stoian Dan

πŸ–‹

Pi Delport

πŸ–‹

Sateesh

πŸ’» πŸ–‹

ZC

πŸ–‹

hyperparabolic

πŸ’»

arlecchino

πŸ“–

Richthofen

πŸ’»

Ivan Nerazumov

πŸ“–

lauralindzey

πŸ“–

Rakshit Sinha

πŸ–‹

Damian

πŸ–‹

Ben Armstead

πŸ’»

anuk909

πŸ–‹ πŸ’»

granddaifuku

πŸ–‹

Weilet

πŸ–‹

LIU JIE

πŸ–‹

Antoine BΓΌsch

πŸ’»

frogtd

πŸ–‹

Zhenghao Lu

πŸ–‹

Fredrik Enestad

πŸ–‹

xuesong

πŸ–‹

Michael Walsh

πŸ’»

alirezaghey

πŸ–‹

Franklin van Nes

πŸ’»

nekonako

πŸ’»

ZX

πŸ–‹

Yang Wen

πŸ–‹

Brandon High

πŸ“–

x-hgg-x

πŸ’»
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! From 3f0e1303e0b3bf3fecc0baced3c8b8a37f83c184 Mon Sep 17 00:00:00 2001 From: Lucas Aries <73198738+Kallu-A@users.noreply.github.com> Date: Tue, 29 Mar 2022 15:02:35 +0200 Subject: [PATCH 39/92] feat: Add move_semantics6.rs exercise (#908) --- exercises/move_semantics/move_semantics6.rs | 25 +++++++++++++++++++++ info.toml | 15 +++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 exercises/move_semantics/move_semantics6.rs diff --git a/exercises/move_semantics/move_semantics6.rs b/exercises/move_semantics/move_semantics6.rs new file mode 100644 index 00000000..457e7ae7 --- /dev/null +++ b/exercises/move_semantics/move_semantics6.rs @@ -0,0 +1,25 @@ +// move_semantics6.rs +// Make me compile! `rustlings hint move_semantics6` for hints +// You can't change anything except adding or removing references + +// I AM NOT DONE + +fn main() { + let data = "Rust is great!".to_string(); + + get_char(data); + + string_uppercase(&data); +} + +// Should not take ownership +fn get_char(data: String) -> char { + data.chars().last().unwrap() +} + +// Should take ownership +fn string_uppercase(mut data: &String) { + data = &data.to_uppercase(); + + println!("{}", data); +} diff --git a/info.toml b/info.toml index fbe0d53b..9430a161 100644 --- a/info.toml +++ b/info.toml @@ -237,6 +237,21 @@ in the book's section References and Borrowing': https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references. """ +[[exercises]] +name = "move_semantics6" +path = "exercises/move_semantics/move_semantics6.rs" +mode = "compile" +hint = """ +To find the answer, you can consult the book section "References and Borrowing": +https://doc.rust-lang.org/stable/book/ch04-02-references-and-borrowing.html +The first problem is that `get_char` is taking ownership of the string. +So `data` is moved and can't be used for `string_uppercase` +`data` is moved to `get_char` first, meaning that `string_uppercase` cannot manipulate the data. +Once you've fixed that, `string_uppercase`'s function signature will also need to be adjusted. +Can you figure out how? + +Another hint: it has to do with the `&` character.""" + # PRIMITIVE TYPES [[exercises]] From 2ca5250f78cba3276b9284af5f0f49e5ce296f71 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 13:02:51 +0000 Subject: [PATCH 40/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 9813bd17..a7f29bb2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -157,6 +157,10 @@ authors.
Yang Wen

πŸ–‹
Brandon High

πŸ“–
x-hgg-x

πŸ’» +
Kisaragi

πŸ“– + + +
Lucas Aries

πŸ–‹ From d4e3d98d0abe732df08ee6fe85ef276b7805257e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 13:02:52 +0000 Subject: [PATCH 41/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index c07ac794..24832b42 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1110,6 +1110,15 @@ "contributions": [ "doc" ] + }, + { + "login": "Kallu-A", + "name": "Lucas Aries", + "avatar_url": "https://avatars.githubusercontent.com/u/73198738?v=4", + "profile": "https://github.com/Kallu-A", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From bdf6efeccde2a669571fcc5dd68801c88c72d0f1 Mon Sep 17 00:00:00 2001 From: mokou Date: Tue, 29 Mar 2022 15:04:52 +0200 Subject: [PATCH 42/92] chore: clean up readme --- README.md | 178 +++--------------------------------------------------- 1 file changed, 7 insertions(+), 171 deletions(-) diff --git a/README.md b/README.md index fdae4acb..babc3423 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ - -[![All Contributors](https://img.shields.io/badge/all_contributors-119-orange.svg?style=flat-square)](#contributors-) - - # rustlings πŸ¦€β€οΈ Greetings and welcome to `rustlings`. This project contains small exercises to get you used to reading and writing Rust code. This includes reading and responding to compiler messages! @@ -68,6 +64,7 @@ cargo install --force --path . ``` If there are installation errors, ensure that your toolchain is up to date. For the latest, run: + ```bash rustup update ``` @@ -107,17 +104,18 @@ rustlings run next In case you get stuck, you can run the following command to get a hint for your exercise: -``` bash +```bash rustlings hint myExercise1 ``` You can also get the hint for the next unsolved exercise with the following command: -``` bash +```bash rustlings hint next ``` To check your progress, you can run the following command: + ```bash rustlings list ``` @@ -135,14 +133,14 @@ Once you've completed Rustlings, put your new knowledge to good use! Continue pr If you want to remove Rustlings from your system, there's two steps. First, you'll need to remove the exercises folder that the install script created for you: -``` bash +```bash rm -rf rustlings # or your custom folder name, if you chose and or renamed it ``` Second, since Rustlings got installed via `cargo install`, it's only reasonable to assume that you can also remove it using Cargo, and exactly that is the case. Run `cargo uninstall` to remove the `rustlings` binary: -``` bash +```bash cargo uninstall rustlings ``` @@ -172,166 +170,4 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md). ## Contributors ✨ -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Carol (Nichols || Goulding)

πŸ’» πŸ–‹

QuietMisdreavus

πŸ’» πŸ–‹

Robert M Lugg

πŸ–‹

Hynek Schlawack

πŸ’»

Katharina Fey

πŸ’»

lukabavdaz

πŸ’» πŸ–‹

Erik Vesteraas

πŸ’»

delet0r

πŸ’»

Shaun Bennett

πŸ’»

Andrew Bagshaw

πŸ’»

Kyle Isom

πŸ’»

Colin Pitrat

πŸ’»

Zac Anger

πŸ’»

Matthias Geier

πŸ’»

Chris Pearce

πŸ’»

Yvan Sraka

πŸ’»

Denys Smirnov

πŸ’»

eddyp

πŸ’»

Brian Kung

πŸ’» πŸ–‹

Russell

πŸ’»

Dan Wilhelm

πŸ“–

Jesse

πŸ’» πŸ–‹

Fredrik JambrΓ©n

πŸ’»

Pete McFarlane

πŸ–‹

nkanderson

πŸ’» πŸ–‹

Ajax M

πŸ“–

Dylan Nugent

πŸ–‹

vyaslav

πŸ’» πŸ–‹

George

πŸ’»

Thomas Holloway

πŸ’» πŸ–‹

Jubilee

πŸ’»

WofWca

πŸ’»

Roberto Vidal

πŸ’» πŸ“– πŸ€” 🚧

Jens

πŸ“–

Rahat Ahmed

πŸ“–

Abdou Seck

πŸ’» πŸ–‹ πŸ‘€

Katie

πŸ’»

Socrates

πŸ“–

gnodarse

πŸ–‹

Harrison Metzger

πŸ’»

Torben Jonas

πŸ’» πŸ–‹

Paul Bissex

πŸ“–

Steven Mann

πŸ’» πŸ–‹

Mario Reder

πŸ’» πŸ–‹

skim

πŸ’»

Sanjay K

πŸ’» πŸ–‹

Rohan Jain

πŸ’»

Said Aspen

πŸ’» πŸ–‹

Ufuk Celebi

πŸ’»

lebedevsergey

πŸ“–

Aleksei Trifonov

πŸ–‹

Darren Meehan

πŸ–‹

Jihchi Lee

πŸ–‹

Christofer Bertonha

πŸ–‹

Vivek Bharath Akupatni

πŸ’» ⚠️

DΓ­dac SementΓ© FernΓ‘ndez

πŸ’» πŸ–‹

Rob Story

πŸ’»

Siobhan Jacobson

πŸ’»

Evan Carroll

πŸ–‹

Jawaad Mahmood

πŸ–‹

Gaurang Tandon

πŸ–‹

Stefan Kupresak

πŸ–‹

Greg Leonard

πŸ–‹

Ryan McQuen

πŸ’»

Annika

πŸ‘€

Axel Viala

πŸ’»

Mohammed Sazid Al Rashid

πŸ–‹ πŸ’»

Caleb Webber

🚧

Peter N

🚧

seancad

🚧

Will Hayworth

πŸ–‹

Christian Zeller

πŸ–‹

Jean-Francois Chevrette

πŸ–‹ πŸ’»

John Baber-Lucero

πŸ–‹

Tal

πŸ–‹

apogeeoak

πŸ–‹ πŸ’»

Larry Garfield

πŸ–‹

circumspect

πŸ–‹

Cyrus Wyett

πŸ–‹

cadolphs

πŸ’»

Pascal H.

πŸ–‹

Rod Elias

πŸ–‹

Matt Lebl

πŸ’»

Ignacio Le Fluk

πŸ–‹

Taylor Yu

πŸ’» πŸ–‹

Patrick Hintermayer

πŸ’»

Pete Pavlovski

πŸ–‹

k12ish

πŸ–‹

Shao Yang Hong

πŸ–‹

Brandon Macer

πŸ–‹

Stoian Dan

πŸ–‹

Pi Delport

πŸ–‹

Sateesh

πŸ’» πŸ–‹

ZC

πŸ–‹

hyperparabolic

πŸ’»

arlecchino

πŸ“–

Richthofen

πŸ’»

Ivan Nerazumov

πŸ“–

lauralindzey

πŸ“–

Rakshit Sinha

πŸ–‹

Damian

πŸ–‹

Ben Armstead

πŸ’»

anuk909

πŸ–‹ πŸ’»

granddaifuku

πŸ–‹

Weilet

πŸ–‹

LIU JIE

πŸ–‹

Antoine BΓΌsch

πŸ’»

frogtd

πŸ–‹

Zhenghao Lu

πŸ–‹

Fredrik Enestad

πŸ–‹

xuesong

πŸ–‹

Michael Walsh

πŸ’»

alirezaghey

πŸ–‹

Franklin van Nes

πŸ’»

nekonako

πŸ’»

ZX

πŸ–‹

Yang Wen

πŸ–‹

Brandon High

πŸ“–

x-hgg-x

πŸ’»
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! +Thanks goes to the wonderful people listed in [AUTHORS.md](./AUTHORS.md) πŸŽ‰ From 0bd7a0631a17a9d69af5746795a30efc9cf64e6e Mon Sep 17 00:00:00 2001 From: Soroush Zare Date: Wed, 30 Mar 2022 15:57:52 +0430 Subject: [PATCH 43/92] fix(iterators1): reorder TODO steps Update the TODO steps in the iterators1 exercise. --- exercises/standard_library_types/iterators1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/standard_library_types/iterators1.rs b/exercises/standard_library_types/iterators1.rs index 4606ad35..5aa49b64 100644 --- a/exercises/standard_library_types/iterators1.rs +++ b/exercises/standard_library_types/iterators1.rs @@ -18,7 +18,7 @@ fn main () { assert_eq!(my_iterable_fav_fruits.next(), Some(&"banana")); assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 2 assert_eq!(my_iterable_fav_fruits.next(), Some(&"avocado")); - assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 2.1 - assert_eq!(my_iterable_fav_fruits.next(), Some(&"raspberry")); assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 3 + assert_eq!(my_iterable_fav_fruits.next(), Some(&"raspberry")); + assert_eq!(my_iterable_fav_fruits.next(), ???); // TODO: Step 4 } From 4dfd85ff05bc7e624909a32ce92bfd8d68bb1669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Have=CC=81?= Date: Sun, 3 Apr 2022 23:45:45 +0200 Subject: [PATCH 44/92] fix(move_semantics) : add move_semantics6.rs to its mod --- exercises/move_semantics/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/move_semantics/mod.rs b/exercises/move_semantics/mod.rs index c9e61b36..e8eecf0a 100644 --- a/exercises/move_semantics/mod.rs +++ b/exercises/move_semantics/mod.rs @@ -3,3 +3,4 @@ mod move_semantics2; mod move_semantics3; mod move_semantics4; mod move_semantics5; +mod move_semantics6; From d114847f256c5f571c0b4c87e04b04bce3435509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Have=CC=81?= Date: Sun, 3 Apr 2022 19:49:59 +0200 Subject: [PATCH 45/92] fix(install): protect path with whitespaces using quotes and stop at the first error --- install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 68b8da3a..1d9cff27 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -euo pipefail echo "Let's get you set up with Rustlings!" @@ -100,8 +101,8 @@ function vercomp() { RustVersion=$(rustc --version | cut -d " " -f 2) MinRustVersion=1.39 -vercomp $RustVersion $MinRustVersion -if [ $? -eq 2 ] +vercomp "$RustVersion" $MinRustVersion || ec=$? +if [ ${ec:-0} -eq 2 ] then echo "ERROR: Rust version is too old: $RustVersion - needs at least $MinRustVersion" echo "Please update Rust with 'rustup update'" @@ -112,9 +113,9 @@ fi Path=${1:-rustlings/} echo "Cloning Rustlings at $Path..." -git clone -q https://github.com/rust-lang/rustlings $Path +git clone -q https://github.com/rust-lang/rustlings "$Path" -cd $Path +cd "$Path" Version=$(curl -s https://api.github.com/repos/rust-lang/rustlings/releases/latest | ${PY} -c "import json,sys;obj=json.load(sys.stdin);print(obj['tag_name']);") CargoBin="${CARGO_HOME:-$HOME/.cargo}/bin" From 89650f808af23a32c9a2c6d46592b77547a6a464 Mon Sep 17 00:00:00 2001 From: ragreenburg Date: Wed, 6 Apr 2022 00:29:27 -0700 Subject: [PATCH 46/92] fix(move_semantics2): Add comment --- exercises/move_semantics/move_semantics2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/move_semantics/move_semantics2.rs b/exercises/move_semantics/move_semantics2.rs index bd21fbb7..888dc529 100644 --- a/exercises/move_semantics/move_semantics2.rs +++ b/exercises/move_semantics/move_semantics2.rs @@ -1,5 +1,5 @@ // move_semantics2.rs -// Make me compile without changing line 13! +// Make me compile without changing line 13 or moving line 10! // Execute `rustlings hint move_semantics2` for hints :) // I AM NOT DONE From d3c5058d89c08cffb8be34491147a0d8976c3b0b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 07:29:49 +0000 Subject: [PATCH 47/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index a7f29bb2..a81018cc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -161,6 +161,7 @@ authors.
Lucas Aries

πŸ–‹ +
ragreenburg

πŸ–‹ From b1cdce6289934fe4a73e6f22265c13fa463208d3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 07:29:50 +0000 Subject: [PATCH 48/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 24832b42..66a8eabf 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1119,6 +1119,15 @@ "contributions": [ "content" ] + }, + { + "login": "ragreenburg", + "name": "ragreenburg", + "avatar_url": "https://avatars.githubusercontent.com/u/24358100?v=4", + "profile": "https://github.com/ragreenburg", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 43d0623086edbc46fe896ba59c7afa22c3da9f7a Mon Sep 17 00:00:00 2001 From: J-S-Kim Date: Sat, 9 Apr 2022 01:23:58 +0900 Subject: [PATCH 49/92] fix(errors6.rs): remove one answer code Although marked as 'TODO', three tests pass without any implementation because the correct answer code already exists. --- exercises/error_handling/errors6.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/exercises/error_handling/errors6.rs b/exercises/error_handling/errors6.rs index 0f6b27a6..847a049a 100644 --- a/exercises/error_handling/errors6.rs +++ b/exercises/error_handling/errors6.rs @@ -20,9 +20,6 @@ enum ParsePosNonzeroError { } impl ParsePosNonzeroError { - fn from_creation(err: CreationError) -> ParsePosNonzeroError { - ParsePosNonzeroError::Creation(err) - } // TODO: add another error conversion function here. } From 60bb7cc3931d21d3986ad52b2b302e632a93831c Mon Sep 17 00:00:00 2001 From: stevenfukase Date: Thu, 14 Apr 2022 17:25:44 +0900 Subject: [PATCH 50/92] Fix test (#958) fix(errors1): don't modify tests --- exercises/error_handling/errors1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/error_handling/errors1.rs b/exercises/error_handling/errors1.rs index 5844a497..243622c4 100644 --- a/exercises/error_handling/errors1.rs +++ b/exercises/error_handling/errors1.rs @@ -28,7 +28,7 @@ mod tests { fn generates_nametag_text_for_a_nonempty_name() { assert_eq!( generate_nametag_text("BeyoncΓ©".into()), - Some("Hi! My name is BeyoncΓ©".into()) + Ok("Hi! My name is BeyoncΓ©".into()) ); } From 887b6e183b9657403553188a89aa0afaacf5ab9a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:26:06 +0000 Subject: [PATCH 51/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index a81018cc..5d7f5cdb 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -162,6 +162,7 @@ authors.
Lucas Aries

πŸ–‹
ragreenburg

πŸ–‹ +
stevenfukase

πŸ–‹ From 7dcc1fca29d1796608389c7b98034f27e61c9f6a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:26:07 +0000 Subject: [PATCH 52/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 66a8eabf..4d0e9082 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1128,6 +1128,15 @@ "contributions": [ "content" ] + }, + { + "login": "stevenfukase", + "name": "stevenfukase", + "avatar_url": "https://avatars.githubusercontent.com/u/66785624?v=4", + "profile": "https://github.com/stevenfukase", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 76a36dd38594c63b4bd64e655efeb272ccfaf2a4 Mon Sep 17 00:00:00 2001 From: mokou Date: Thu, 14 Apr 2022 10:32:43 +0200 Subject: [PATCH 53/92] chore: update errors1 comments and hint --- exercises/error_handling/errors1.rs | 8 ++------ info.toml | 6 ++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/exercises/error_handling/errors1.rs b/exercises/error_handling/errors1.rs index 243622c4..c417fb26 100644 --- a/exercises/error_handling/errors1.rs +++ b/exercises/error_handling/errors1.rs @@ -1,9 +1,8 @@ // errors1.rs // This function refuses to generate text to be printed on a nametag if // you pass it an empty string. It'd be nicer if it explained what the problem -// was, instead of just sometimes returning `None`. The 2nd test currently -// does not compile or pass, but it illustrates the behavior we would like -// this function to have. +// was, instead of just sometimes returning `None`. Thankfully, Rust has a similar +// construct to `Option` that can be used to express error conditions. Let's use it! // Execute `rustlings hint errors1` for hints! // I AM NOT DONE @@ -21,9 +20,6 @@ pub fn generate_nametag_text(name: String) -> Option { mod tests { use super::*; - // This test passes initially if you comment out the 2nd test. - // You'll need to update what this test expects when you change - // the function under test! #[test] fn generates_nametag_text_for_a_nonempty_name() { assert_eq!( diff --git a/info.toml b/info.toml index 9430a161..56fa7ec5 100644 --- a/info.toml +++ b/info.toml @@ -490,7 +490,7 @@ name = "errors1" path = "exercises/error_handling/errors1.rs" mode = "test" hint = """ -`Err` is one of the variants of `Result`, so what the 2nd test is saying +`Ok` and `Err` are one of the variants of `Result`, so what the tests are saying is that `generate_nametag_text` should return a `Result` instead of an `Option`. @@ -500,9 +500,7 @@ To make this change, you'll need to: - change the body of the function to return `Ok(stuff)` where it currently returns `Some(stuff)` - change the body of the function to return `Err(error message)` where it - currently returns `None` - - change the first test to expect `Ok(stuff)` where it currently expects - `Some(stuff)`.""" + currently returns `None`""" [[exercises]] name = "errors2" From 4bb94e050bb19e421b69467ea49f1e221e966038 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:44:38 +0000 Subject: [PATCH 54/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 5d7f5cdb..1dc56475 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -163,6 +163,7 @@ authors.
Lucas Aries

πŸ–‹
ragreenburg

πŸ–‹
stevenfukase

πŸ–‹ +
J-S-Kim

πŸ–‹ From 03ba8836f2527bc30f4c86f678d91e4d4199a4bf Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:44:39 +0000 Subject: [PATCH 55/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4d0e9082..26fd5c99 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1137,6 +1137,15 @@ "contributions": [ "content" ] + }, + { + "login": "J-S-Kim", + "name": "J-S-Kim", + "avatar_url": "https://avatars.githubusercontent.com/u/17569303?v=4", + "profile": "https://github.com/J-S-Kim", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 6c87dc82102ef7cc29ce8cf6370684cfd6668d92 Mon Sep 17 00:00:00 2001 From: mokou Date: Thu, 14 Apr 2022 11:09:27 +0200 Subject: [PATCH 56/92] docs: update changelog for new release --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc39e42..24da1bc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ + +## 4.7.0 (2022-04-14) + + +#### Features + +* Add move_semantics6.rs exercise (#908) ([3f0e1303](https://github.com/rust-lang/rustlings/commit/3f0e1303e0b3bf3fecc0baced3c8b8a37f83c184)) +* **intro:** Add intro section. ([21c9f441](https://github.com/rust-lang/rustlings/commit/21c9f44168394e08338fd470b5f49b1fd235986f)) +* Include exercises folder in the project structure behind a feature, enabling rust-analyzer to work (#917) ([179a75a6](https://github.com/rust-lang/rustlings/commit/179a75a68d03ac9518dec2297fb17f91a4fc506b)) + +#### Bug Fixes + +* Fix a few spelling mistakes ([1c0fe3cb](https://github.com/rust-lang/rustlings/commit/1c0fe3cbcca85f90b3985985b8e265ee872a2ab2)) +* **cli:** + * Move long text strings into constants. ([f78c4802](https://github.com/rust-lang/rustlings/commit/f78c48020830d7900dd8d81f355606581670446d)) + * Replace `filter_map()` with `find_map()` ([9b27e8d](https://github.com/rust-lang/rustlings/commit/9b27e8d993ca20232fe38a412750c3f845a83b65)) +* **clippy1:** + * Set clippy::float_cmp lint to deny (#907) ([71a06044](https://github.com/rust-lang/rustlings/commit/71a06044e6a96ff756dc31d7b0ed665ae4badb57)) + * Updated code to test correctness clippy lint with approx_constant lint rule ([f2650de3](https://github.com/rust-lang/rustlings/commit/f2650de369810867d2763e935ac0963c32ec420e)) +* **errors1:** + * Add a comment to make the purpose more clear (#486) ([cbcde345](https://github.com/rust-lang/rustlings/commit/cbcde345409c3e550112e449242848eaa3391bb6)) + * Don't modify tests (#958) ([60bb7cc](https://github.com/rust-lang/rustlings/commit/60bb7cc3931d21d3986ad52b2b302e632a93831c)) +* **errors6:** Remove existing answer code ([43d0623](https://github.com/rust-lang/rustlings/commit/43d0623086edbc46fe896ba59c7afa22c3da9f7a)) +* **functions5:** Remove wrong new line and small English improvements (#885) ([8ef4869b](https://github.com/rust-lang/rustlings/commit/8ef4869b264094e5a9b50452b4534823a9df19c3)) +* **install:** protect path with whitespaces using quotes and stop at the first error ([d114847f](https://github.com/rust-lang/rustlings/commit/d114847f256c5f571c0b4c87e04b04bce3435509)) +* **intro1:** Add compiler error explanation. ([9b8de655](https://github.com/rust-lang/rustlings/commit/9b8de65525a5576b78cf0c8e4098cdd34296338f)) +* **iterators1:** reorder TODO steps ([0bd7a063](https://github.com/rust-lang/rustlings/commit/0bd7a0631a17a9d69af5746795a30efc9cf64e6e)) +* **move_semantics2:** Add comment ([89650f80](https://github.com/rust-lang/rustlings/commit/89650f808af23a32c9a2c6d46592b77547a6a464)) +* **move_semantics5:** correct typo (#857) ([46c28d5c](https://github.com/rust-lang/rustlings/commit/46c28d5cef3d8446b5a356b19d8dbc725f91a3a0)) +* **quiz1:** update to say quiz covers "If" ([1622e8c1](https://github.com/rust-lang/rustlings/commit/1622e8c198d89739765c915203efff0091bdeb78)) +* **structs3:** + * Add a hint for panic (#608) ([4f7ff5d9](https://github.com/rust-lang/rustlings/commit/4f7ff5d9c7b2d8b045194c1a9469d37e30257c4a)) + * remove redundant 'return' (#852) ([bf33829d](https://github.com/rust-lang/rustlings/commit/bf33829da240375d086f96267fc2e02fa6b07001)) + * Assigned value to `cents_per_gram` in test ([d1ee2da](https://github.com/rust-lang/rustlings/commit/d1ee2daf14f19105e6db3f9c610f44293d688532)) +* **structs3.rs:** assigned value to cents_per_gram in test ([d1ee2daf](https://github.com/rust-lang/rustlings/commit/d1ee2daf14f19105e6db3f9c610f44293d688532)) +* **traits1:** rename test functions to snake case (#854) ([1663a16e](https://github.com/rust-lang/rustlings/commit/1663a16eade6ca646b6ed061735f7982434d530d)) + +#### Documentation improvements + +* Add hints on how to get GCC installed (#741) ([bc56861](https://github.com/rust-lang/rustlings/commit/bc5686174463ad6f4f6b824b0e9b97c3039d4886)) +* Fix some code blocks that were not highlighted ([17f9d74](https://github.com/rust-lang/rustlings/commit/17f9d7429ccd133a72e815fb5618e0ce79560929)) + + ## 4.6.0 (2021-09-25) From 8f33dba9caaf59d19a174d39ec0373241807eb6e Mon Sep 17 00:00:00 2001 From: mokou Date: Thu, 14 Apr 2022 11:15:04 +0200 Subject: [PATCH 57/92] docs: write documentation for enabling rust-analyzer --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index babc3423..876578ee 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,27 @@ rustlings list After every couple of sections, there will be a quiz that'll test your knowledge on a bunch of sections at once. These quizzes are found in `exercises/quizN.rs`. +## Enabling `rust-analyzer` + +`rust-analyzer` support is provided, but it depends on your editor +whether it's enabled by default. (RLS support is not provided) + +To enable `rust-analyzer`, you'll need to make Cargo build the project +with the `exercises` feature, which will automatically include the `exercises/` +subfolder in the project. The easiest way to do this is to tell your editor to +build the project with all features (the equivalent of `cargo build --all-features`). +For specific editor instructions: + +- **VSCode**: Add a `.vscode/settings.json` file with the following: +```json +{ + "rust-analyzer.cargo.features": ["exercises"] +} +``` +- **IntelliJ-based Editors**: Using the Rust plugin, everything should work + by default. +- _Missing your editor? Feel free to contribute more instructions!_ + ## Continuing On Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to. From cf9f382873a8ec167803ff575004048240dc0532 Mon Sep 17 00:00:00 2001 From: mokou Date: Thu, 14 Apr 2022 11:16:00 +0200 Subject: [PATCH 58/92] chore: bump version --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- src/main.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e536d1b7..c3e8290f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -541,7 +541,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rustlings" -version = "4.6.0" +version = "4.7.0" dependencies = [ "argh", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 4761c9a4..a340cd21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rustlings" -version = "4.6.0" -authors = ["anastasie ", "Carol (Nichols || Goulding) "] +version = "4.7.0" +authors = ["mokou ", "Carol (Nichols || Goulding) "] edition = "2021" [dependencies] diff --git a/src/main.rs b/src/main.rs index 453b8c0b..e8591f7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,7 +24,7 @@ mod run; mod verify; // In sync with crate version -const VERSION: &str = "4.6.0"; +const VERSION: &str = "4.7.0"; #[derive(FromArgs, PartialEq, Debug)] /// Rustlings is a collection of small exercises to get you used to writing and reading Rust code From 0b7f3fe37a6f202d85607ae30d07736a9202d489 Mon Sep 17 00:00:00 2001 From: mokou Date: Thu, 14 Apr 2022 11:19:54 +0200 Subject: [PATCH 59/92] test: skip mod.rs files when checking for annotations --- tests/integration_tests.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index be9af965..fc46b983 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -125,6 +125,9 @@ fn get_hint_for_single_test() { fn all_exercises_require_confirmation() { for exercise in glob("exercises/**/*.rs").unwrap() { let path = exercise.unwrap(); + if path.file_name().unwrap() == "mod.rs" { + continue + } let source = { let mut file = File::open(&path).unwrap(); let mut s = String::new(); From 92a5d0037f0124eb2cdd8637762ca6aa4494fcbd Mon Sep 17 00:00:00 2001 From: fointard Date: Tue, 19 Apr 2022 17:11:27 +0200 Subject: [PATCH 60/92] refactor(arc1): improve readability by using functional style --- exercises/standard_library_types/arc1.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/exercises/standard_library_types/arc1.rs b/exercises/standard_library_types/arc1.rs index d167380c..f60061e7 100644 --- a/exercises/standard_library_types/arc1.rs +++ b/exercises/standard_library_types/arc1.rs @@ -32,12 +32,7 @@ fn main() { for offset in 0..8 { let child_numbers = // TODO joinhandles.push(thread::spawn(move || { - let mut i = offset; - let mut sum = 0; - while i < child_numbers.len() { - sum += child_numbers[i]; - i += 8; - } + let sum: u32 = child_numbers.iter().filter(|n| *n % 8 == offset).sum(); println!("Sum of offset {} is {}", offset, sum); })); } From 452ab26aa735c85756ca0ec91453fe72d487af1b Mon Sep 17 00:00:00 2001 From: fointard Date: Tue, 19 Apr 2022 17:37:00 +0200 Subject: [PATCH 61/92] refactor(using_as): improve readability by using sum() instead of fold() --- exercises/conversions/using_as.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/conversions/using_as.rs b/exercises/conversions/using_as.rs index 821309ec..f3f745ff 100644 --- a/exercises/conversions/using_as.rs +++ b/exercises/conversions/using_as.rs @@ -8,7 +8,7 @@ // I AM NOT DONE fn average(values: &[f64]) -> f64 { - let total = values.iter().fold(0.0, |a, b| a + b); + let total = values.iter().sum::(); total / values.len() } From 107f1f97d96cb79513a7ff62d92e52c4296a69e8 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 07:14:26 +0000 Subject: [PATCH 62/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 1dc56475..9b388bb4 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -164,6 +164,7 @@ authors.
ragreenburg

πŸ–‹
stevenfukase

πŸ–‹
J-S-Kim

πŸ–‹ +
Fointard

πŸ–‹ From c9b73e412ed49f05c999a3ecf640209d5700dfac Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 07:14:27 +0000 Subject: [PATCH 63/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 26fd5c99..d3f0c2ce 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1146,6 +1146,15 @@ "contributions": [ "content" ] + }, + { + "login": "Fointard", + "name": "Fointard", + "avatar_url": "https://avatars.githubusercontent.com/u/9333398?v=4", + "profile": "https://github.com/Fointard", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 268822dbd833435673889f6da04020d20b30acb8 Mon Sep 17 00:00:00 2001 From: mokou Date: Wed, 20 Apr 2022 09:20:42 +0200 Subject: [PATCH 64/92] chore: bump minimum required rust version in installs --- install.ps1 | 2 +- install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index 32167f06..97980c5b 100644 --- a/install.ps1 +++ b/install.ps1 @@ -53,7 +53,7 @@ function vercomp($v1, $v2) { } $rustVersion = $(rustc --version).Split(" ")[1] -$minRustVersion = "1.39" +$minRustVersion = "1.56" if ((vercomp $rustVersion $minRustVersion) -eq 2) { Write-Host "WARNING: Rust version is too old: $rustVersion - needs at least $minRustVersion" Write-Host "Please update Rust with 'rustup update'" diff --git a/install.sh b/install.sh index 1d9cff27..bf517851 100755 --- a/install.sh +++ b/install.sh @@ -100,7 +100,7 @@ function vercomp() { } RustVersion=$(rustc --version | cut -d " " -f 2) -MinRustVersion=1.39 +MinRustVersion=1.56 vercomp "$RustVersion" $MinRustVersion || ec=$? if [ ${ec:-0} -eq 2 ] then From c811643d1e28dc573c5862ccfd4901d6860f5855 Mon Sep 17 00:00:00 2001 From: mokou Date: Wed, 20 Apr 2022 09:35:08 +0200 Subject: [PATCH 65/92] chore: bump library versions --- Cargo.lock | 140 +++++--------------------------------------------- Cargo.toml | 14 ++--- src/run.rs | 4 +- src/verify.rs | 8 +-- 4 files changed, 27 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c3e8290f..ce894363 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,17 +52,6 @@ dependencies = [ "predicates-tree", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi 0.3.9", -] - [[package]] name = "autocfg" version = "1.0.1" @@ -87,45 +76,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "clicolors-control" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90082ee5dcdd64dc4e9e0d37fbf3ee325419e39c0092191e0393df65518f741e" -dependencies = [ - "atty", - "lazy_static", - "libc", - "winapi 0.3.9", -] - [[package]] name = "console" -version = "0.7.7" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628" -dependencies = [ - "atty", - "clicolors-control", - "encode_unicode", - "lazy_static", - "libc", - "parking_lot", - "regex", - "termios", - "unicode-width", - "winapi 0.3.9", -] - -[[package]] -name = "console" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" +checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" dependencies = [ "encode_unicode", - "lazy_static", "libc", + "once_cell", "regex", "terminal_size", "unicode-width", @@ -227,25 +186,15 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "indicatif" -version = "0.10.3" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd1e2ee08e6c255ce890f5a99d17000850e664e7acf119fb03b25b0575bfe" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" dependencies = [ - "console 0.14.1", + "console", "lazy_static", "number_prefix", - "parking_lot", "regex", ] @@ -269,15 +218,6 @@ dependencies = [ "libc", ] -[[package]] -name = "instant" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "iovec" version = "0.1.4" @@ -321,15 +261,6 @@ version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5" -[[package]] -name = "lock_api" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" -dependencies = [ - "scopeguard", -] - [[package]] name = "log" version = "0.4.14" @@ -434,37 +365,15 @@ dependencies = [ [[package]] name = "number_prefix" -version = "0.2.8" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" -dependencies = [ - "num-traits", -] +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] -name = "parking_lot" -version = "0.11.1" +name = "once_cell" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", -] +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "predicates" @@ -545,7 +454,7 @@ version = "4.7.0" dependencies = [ "argh", "assert_cmd", - "console 0.7.7", + "console", "glob", "indicatif", "notify", @@ -570,12 +479,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - [[package]] name = "serde" version = "1.0.129" @@ -613,12 +516,6 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" -[[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - [[package]] name = "syn" version = "1.0.75" @@ -640,20 +537,11 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "termios" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" -dependencies = [ - "libc", -] - [[package]] name = "toml" -version = "0.4.10" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index a340cd21..e8ded146 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,13 +5,13 @@ authors = ["mokou ", "Carol (Nichols || Goulding) Result<(), ()> { // This is strictly for non-test binaries, so output is displayed fn compile_and_run(exercise: &Exercise) -> Result<(), ()> { let progress_bar = ProgressBar::new_spinner(); - progress_bar.set_message(format!("Compiling {}...", exercise).as_str()); + progress_bar.set_message(format!("Compiling {}...", exercise)); progress_bar.enable_steady_tick(100); let compilation_result = exercise.compile(); @@ -37,7 +37,7 @@ fn compile_and_run(exercise: &Exercise) -> Result<(), ()> { } }; - progress_bar.set_message(format!("Running {}...", exercise).as_str()); + progress_bar.set_message(format!("Running {}...", exercise)); let result = compilation.run(); progress_bar.finish_and_clear(); diff --git a/src/verify.rs b/src/verify.rs index fd59fa51..eff57141 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -39,7 +39,7 @@ pub fn test(exercise: &Exercise, verbose: bool) -> Result<(), ()> { // Invoke the rust compiler without running the resulting binary fn compile_only(exercise: &Exercise) -> Result { let progress_bar = ProgressBar::new_spinner(); - progress_bar.set_message(format!("Compiling {}...", exercise).as_str()); + progress_bar.set_message(format!("Compiling {}...", exercise)); progress_bar.enable_steady_tick(100); let _ = compile(exercise, &progress_bar)?; @@ -52,12 +52,12 @@ fn compile_only(exercise: &Exercise) -> Result { // Compile the given Exercise and run the resulting binary in an interactive mode fn compile_and_run_interactively(exercise: &Exercise) -> Result { let progress_bar = ProgressBar::new_spinner(); - progress_bar.set_message(format!("Compiling {}...", exercise).as_str()); + progress_bar.set_message(format!("Compiling {}...", exercise)); progress_bar.enable_steady_tick(100); let compilation = compile(exercise, &progress_bar)?; - progress_bar.set_message(format!("Running {}...", exercise).as_str()); + progress_bar.set_message(format!("Running {}...", exercise)); let result = compilation.run(); progress_bar.finish_and_clear(); @@ -80,7 +80,7 @@ fn compile_and_run_interactively(exercise: &Exercise) -> Result { // the output if verbose is set to true fn compile_and_test(exercise: &Exercise, run_mode: RunMode, verbose: bool) -> Result { let progress_bar = ProgressBar::new_spinner(); - progress_bar.set_message(format!("Testing {}...", exercise).as_str()); + progress_bar.set_message(format!("Testing {}...", exercise)); progress_bar.enable_steady_tick(100); let compilation = compile(exercise, &progress_bar)?; From 9ec35d899ce4002b6e1703185dd1f5243d80e30a Mon Sep 17 00:00:00 2001 From: mokou Date: Wed, 20 Apr 2022 09:44:37 +0200 Subject: [PATCH 66/92] chore: bump version Plus, remove the clog configuration file, since that's not being used anymore. --- .clog.toml | 4 ---- CHANGELOG.md | 21 +++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) delete mode 100644 .clog.toml diff --git a/.clog.toml b/.clog.toml deleted file mode 100644 index 206c3b5a..00000000 --- a/.clog.toml +++ /dev/null @@ -1,4 +0,0 @@ -[clog] - -repository = "https://github.com/rust-lang/rustlings" -changelog = "CHANGELOG.md" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 24da1bc0..e857e339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ + +## 4.7.1 (2022-04-20) + +#### Features + +- The amount of dependency crates that need to be compiled went down from ~65 to + ~45 by bumping dependency versions. +- The minimum Rust version in the install scripts has been bumped to 1.56.0 (this isn't in + the release itself, since install scripts don't really get versioned) + +#### Bug Fixes + +- **arc1**: A small part has been rewritten using a more functional code style (#968). +- **using_as**: A small part has been refactored to use `sum` instead of `fold`, resulting + in better readability. + +#### Housekeeping + +- The changelog will now be manually written instead of being automatically generated by the + Git log. + ## 4.7.0 (2022-04-14) diff --git a/Cargo.lock b/Cargo.lock index ce894363..27521e7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,7 +450,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rustlings" -version = "4.7.0" +version = "4.7.1" dependencies = [ "argh", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index e8ded146..befdd6e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustlings" -version = "4.7.0" +version = "4.7.1" authors = ["mokou ", "Carol (Nichols || Goulding) "] edition = "2021" diff --git a/src/main.rs b/src/main.rs index e8591f7d..83b98d96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,7 +24,7 @@ mod run; mod verify; // In sync with crate version -const VERSION: &str = "4.7.0"; +const VERSION: &str = "4.7.1"; #[derive(FromArgs, PartialEq, Debug)] /// Rustlings is a collection of small exercises to get you used to writing and reading Rust code From d2179d3e8442ca3ecd24738e2fa41b31023120e5 Mon Sep 17 00:00:00 2001 From: mokou Date: Wed, 20 Apr 2022 09:47:43 +0200 Subject: [PATCH 67/92] doc: update manual checkout version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 876578ee..f954618b 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ When you get a permission denied message then you have to exclude the directory Basically: Clone the repository at the latest tag, run `cargo install`. ```bash -# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 4.6.0) -git clone -b 4.6.0 --depth 1 https://github.com/rust-lang/rustlings +# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 4.7.1) +git clone -b 4.7.1 --depth 1 https://github.com/rust-lang/rustlings cd rustlings cargo install --force --path . ``` From 8dc696883ee8f7c0eb6da75cdcc7b58f40872e15 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:36:52 +0000 Subject: [PATCH 68/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 9b388bb4..ad8ce474 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -165,6 +165,7 @@ authors.
stevenfukase

πŸ–‹
J-S-Kim

πŸ–‹
Fointard

πŸ–‹ +
Ryan Lowe

πŸ’» From 283a4691aa7155cb896650abcf962066d12cb0d6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:36:53 +0000 Subject: [PATCH 69/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d3f0c2ce..d995be80 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1155,6 +1155,15 @@ "contributions": [ "content" ] + }, + { + "login": "rytheo", + "name": "Ryan Lowe", + "avatar_url": "https://avatars.githubusercontent.com/u/22184325?v=4", + "profile": "https://github.com/rytheo", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From b821ffdd332b7359317c88cb4e6fa9a6d290640e Mon Sep 17 00:00:00 2001 From: Ron Lusk Date: Fri, 22 Apr 2022 09:04:36 -0400 Subject: [PATCH 70/92] docs(move_semantics5): Replace "in vogue" with "in scope" in hint The hint for `move_semantics5` refers to "the range in which each mutable reference is in vogue". Unless this is a deliberate introduction of "vogue" (an admittedly-useful term because "scope" isn't purely lexical, as in many other languages), it may be in error: I have been unable to find the term used with reference to *Rust* references. Thus, I'm suggesting the replacement, in case it's been overlooked. --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 56fa7ec5..54a91bfb 100644 --- a/info.toml +++ b/info.toml @@ -231,7 +231,7 @@ path = "exercises/move_semantics/move_semantics5.rs" mode = "compile" hint = """ Carefully reason about the range in which each mutable reference is in -vogue. Does it help to update the value of referent (x) immediately after +scope. Does it help to update the value of referent (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 701dd9c7008f6607f0fab67dc6b44f1294ae9586 Mon Sep 17 00:00:00 2001 From: cuishuang Date: Sat, 23 Apr 2022 21:01:40 +0800 Subject: [PATCH 71/92] fix typo Signed-off-by: cuishuang --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e857e339..1fc12506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -285,7 +285,7 @@ #### Features * add Option2 exercise (#290) ([86b5c08b](https://github.com/rust-lang/rustlings/commit/86b5c08b9bea1576127a7c5f599f5752072c087d)) -* add excercise for option (#282) ([135e5d47](https://github.com/rust-lang/rustlings/commit/135e5d47a7c395aece6f6022117fb20c82f2d3d4)) +* add exercise for option (#282) ([135e5d47](https://github.com/rust-lang/rustlings/commit/135e5d47a7c395aece6f6022117fb20c82f2d3d4)) * add new exercises for generics (#280) ([76be5e4e](https://github.com/rust-lang/rustlings/commit/76be5e4e991160f5fd9093f03ee2ba260e8f7229)) * **ci:** add buildkite config ([b049fa2c](https://github.com/rust-lang/rustlings/commit/b049fa2c84dba0f0c8906ac44e28fd45fba51a71)) From 7eb66550c99997d65ac68906521193243ddaa50e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 09:36:30 +0000 Subject: [PATCH 72/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index ad8ce474..30efeeb6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -166,6 +166,7 @@ authors.
J-S-Kim

πŸ–‹
Fointard

πŸ–‹
Ryan Lowe

πŸ’» +
cui fliter

πŸ–‹ From 190bb27d78f264126ad5dd1e19f191348ac7e370 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 09:36:31 +0000 Subject: [PATCH 73/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d995be80..b9a7aa4c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1164,6 +1164,15 @@ "contributions": [ "code" ] + }, + { + "login": "cuishuang", + "name": "cui fliter", + "avatar_url": "https://avatars.githubusercontent.com/u/15921519?v=4", + "profile": "http://www.dashen.tech", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 9e98b78260c5fba20484533d5b6f0ddbec2a2dd4 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 09:38:18 +0000 Subject: [PATCH 74/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 30efeeb6..169430fe 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -167,6 +167,7 @@ authors.
Fointard

πŸ–‹
Ryan Lowe

πŸ’»
cui fliter

πŸ–‹ +
Ron Lusk

πŸ–‹ From 7a41bbca67935ae0012d145f90c8519b3394f744 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 09:38:19 +0000 Subject: [PATCH 75/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b9a7aa4c..94fef728 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1173,6 +1173,15 @@ "contributions": [ "content" ] + }, + { + "login": "luskwater", + "name": "Ron Lusk", + "avatar_url": "https://avatars.githubusercontent.com/u/42529?v=4", + "profile": "https://github.com/luskwater", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 13832d772646b149368e0470ad65ca0fa3722540 Mon Sep 17 00:00:00 2001 From: Bryan Lee Date: Wed, 27 Apr 2022 00:51:25 +0800 Subject: [PATCH 76/92] docs: replace git.io link with the original URL --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f954618b..fd2d4e42 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ You will need to have Rust installed. You can get it by visiting https://rustup. Just run: ```bash -curl -L https://git.io/install-rustlings | bash +curl -L https://raw.githubusercontent.com/rust-lang/rustlings/master/install.sh | bash # Or if you want it to be installed to a different path: -curl -L https://git.io/install-rustlings | bash -s mypath/ +curl -L https://raw.githubusercontent.com/rust-lang/rustlings/master/install.sh | bash -s mypath/ ``` This will install Rustlings and give you access to the `rustlings` command. Run it to get started! @@ -39,7 +39,7 @@ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser Then, you can run: ```ps1 -Start-BitsTransfer -Source https://git.io/JTL5v -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1 +Start-BitsTransfer -Source https://raw.githubusercontent.com/rust-lang/rustlings/main/install.ps1 -Destination $env:TMP/install_rustlings.ps1; Unblock-File $env:TMP/install_rustlings.ps1; Invoke-Expression $env:TMP/install_rustlings.ps1 ``` To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it. From 659a99032e265a94c0bf9cca12416a404a2cb252 Mon Sep 17 00:00:00 2001 From: mokou Date: Wed, 27 Apr 2022 12:21:54 +0200 Subject: [PATCH 77/92] chore: change branch name to main for cloning --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd2d4e42..5febd651 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ You will need to have Rust installed. You can get it by visiting https://rustup. Just run: ```bash -curl -L https://raw.githubusercontent.com/rust-lang/rustlings/master/install.sh | bash +curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash # Or if you want it to be installed to a different path: -curl -L https://raw.githubusercontent.com/rust-lang/rustlings/master/install.sh | bash -s mypath/ +curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | bash -s mypath/ ``` This will install Rustlings and give you access to the `rustlings` command. Run it to get started! From 144e1ef01821e8d3c14a0d06874c6d4fcd597693 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:22:19 +0000 Subject: [PATCH 78/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 169430fe..4ce36b6a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -169,6 +169,9 @@ authors.
cui fliter

πŸ–‹
Ron Lusk

πŸ–‹ + +
Bryan Lee

πŸ–‹ + From a18f3b8158aaafebcaae2078c968d738ef7389b0 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 10:22:20 +0000 Subject: [PATCH 79/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 94fef728..d90e92c7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1182,6 +1182,15 @@ "contributions": [ "content" ] + }, + { + "login": "liby", + "name": "Bryan Lee", + "avatar_url": "https://avatars.githubusercontent.com/u/38807139?v=4", + "profile": "http://liby.github.io/liby/", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 7027320a8f09d5047c7349635eca7c41bcfe2aec Mon Sep 17 00:00:00 2001 From: likzn <1020193211@qq.com> Date: Wed, 4 May 2022 00:46:49 +0800 Subject: [PATCH 80/92] fix(install.sh):fix arr out of bounds --- install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install.sh b/install.sh index bf517851..7d8ac90c 100755 --- a/install.sh +++ b/install.sh @@ -75,6 +75,21 @@ function vercomp() { then max_len=$len2 fi + + #pad right in short arr + if [[ len1 -gt len2 ]]; + then + for ((i = len2; i < len1; i++)); + do + v2[$i]=0 + done + else + for ((i = len1; i < len2; i++)); + do + v1[$i]=0 + done + fi + for i in `seq 0 $max_len` do # Fill empty fields with zeros in v1 From 769483640c6cb5b00f1be10ec3c7f2d0873a6562 Mon Sep 17 00:00:00 2001 From: Nandaja Varma Date: Mon, 9 May 2022 19:20:04 +0000 Subject: [PATCH 81/92] remove deprecated user uploaded extension from .gitpod.yml --- .gitpod.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 46b1a6a8..73cb802d 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,4 +4,4 @@ tasks: vscode: extensions: - - rust-lang.rust@0.7.8:CvNqMTgDdt3UXt+6BCDTVg== + - rust-lang.rust@0.7.8 diff --git a/README.md b/README.md index 5febd651..dd96a59c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ When you get a permission denied message then you have to exclude the directory [Run on Repl.it](https://repl.it/github/rust-lang/rustlings) -[Open in Gitpod](https://gitpod.io/#https://github.com/rust-lang/rustlings) +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rust-lang/rustlings) ## Manually From b8ff2993999ef3f7b2243f3ce080b66a9d2b1219 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 10:45:13 +0000 Subject: [PATCH 82/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 4ce36b6a..cb997bea 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -171,6 +171,7 @@ authors.
Bryan Lee

πŸ–‹ +
Nandaja Varma

πŸ“– From 89efbdf02d5525733493c341aa03bb3b8ecace19 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 10:45:14 +0000 Subject: [PATCH 83/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d90e92c7..03c84b70 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1191,6 +1191,15 @@ "contributions": [ "content" ] + }, + { + "login": "nandajavarma", + "name": "Nandaja Varma", + "avatar_url": "https://avatars.githubusercontent.com/u/2624550?v=4", + "profile": "http://nandaja.space", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 8, From 5b940165852772d9a009f2f7db50f0a1bda8fd9d Mon Sep 17 00:00:00 2001 From: pwygab <88221256+merelymyself@users.noreply.github.com> Date: Tue, 17 May 2022 17:24:39 +0800 Subject: [PATCH 84/92] check for rustup install --- install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7d8ac90c..f3b3f33d 100755 --- a/install.sh +++ b/install.sh @@ -25,12 +25,21 @@ else exit 1 fi +if [ -x "$(command -v rustup)" ] +then + echo "SUCCESS: rustup is installed" +else + echo "ERROR: rustup does not seem to be installed." + echo "Please download rustup using https://rustup.rs!" + exit 1 +fi + if [ -x "$(command -v rustc)" ] then echo "SUCCESS: Rust is installed" else echo "ERROR: Rust does not seem to be installed." - echo "Please download Rust using https://rustup.rs!" + echo "Please download Rust using rustup!" exit 1 fi @@ -39,7 +48,7 @@ then echo "SUCCESS: Cargo is installed" else echo "ERROR: Cargo does not seem to be installed." - echo "Please download Rust and Cargo using https://rustup.rs!" + echo "Please download Rust and Cargo using rustup!" exit 1 fi From c17177bdefb696611fecd6400fa6eed831eb69fc Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 11:21:33 +0000 Subject: [PATCH 85/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index cb997bea..728481ce 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -172,6 +172,7 @@ authors.
Bryan Lee

πŸ–‹
Nandaja Varma

πŸ“– +
pwygab

πŸ’» From 47afcdcc6b74409102d31390de508e9db4405376 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 11:21:34 +0000 Subject: [PATCH 86/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 03c84b70..4d2034e7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1200,6 +1200,15 @@ "contributions": [ "doc" ] + }, + { + "login": "merelymyself", + "name": "pwygab", + "avatar_url": "https://avatars.githubusercontent.com/u/88221256?v=4", + "profile": "https://github.com/merelymyself", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From b0e079e6bf7963aa9acbd94ac0b190cd93b6f301 Mon Sep 17 00:00:00 2001 From: Lucas Grigolon Varela <37870368+lucasgrvarela@users.noreply.github.com> Date: Fri, 20 May 2022 20:26:37 -0300 Subject: [PATCH 87/92] Update info.toml --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 54a91bfb..32e0d9ab 100644 --- a/info.toml +++ b/info.toml @@ -21,7 +21,7 @@ name = "variables1" path = "exercises/variables/variables1.rs" mode = "compile" hint = """ -Hint: The declaration on line 12 is missing a keyword that is needed in Rust +Hint: The declaration on line 8 is missing a keyword that is needed in Rust to create a new variable binding.""" [[exercises]] From fedabf5f7f89ba4a99e52fe55c5b85f04245c139 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 21 May 2022 14:30:12 +0000 Subject: [PATCH 88/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 728481ce..4853c717 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -173,6 +173,7 @@ authors.
Bryan Lee

πŸ–‹
Nandaja Varma

πŸ“–
pwygab

πŸ’» +
Lucas Grigolon Varela

πŸ–‹ From 439a07445e167de4699f56ffe3c2945e8065c770 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 21 May 2022 14:30:14 +0000 Subject: [PATCH 89/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4d2034e7..295a7d4c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1209,6 +1209,15 @@ "contributions": [ "code" ] + }, + { + "login": "lucasgrvarela", + "name": "Lucas Grigolon Varela", + "avatar_url": "https://avatars.githubusercontent.com/u/37870368?v=4", + "profile": "http://linkedin.com/in/lucasgrvarela", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 0bdb5207b5ea0ae83c2571a1bb16203381936b2e Mon Sep 17 00:00:00 2001 From: Jesse van Papenrecht Date: Sun, 22 May 2022 18:56:26 +0200 Subject: [PATCH 90/92] typo fix in hint message if2 --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 32e0d9ab..efe2b9c7 100644 --- a/info.toml +++ b/info.toml @@ -158,7 +158,7 @@ path = "exercises/if/if2.rs" mode = "test" hint = """ For that first compiler error, it's important in Rust that each conditional -block return the same type! To get the tests passing, you will need a couple +block returns the same type! To get the tests passing, you will need a couple conditions checking different input values.""" # TEST 1 From 34a3c440d0efb172594574ca3ac98bafe2233323 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 13:56:59 +0000 Subject: [PATCH 91/92] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 4853c717..a4b6bdf2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -174,6 +174,7 @@ authors.
Nandaja Varma

πŸ“–
pwygab

πŸ’»
Lucas Grigolon Varela

πŸ–‹ +
Bufo

πŸ–‹ From ffb6ecaf7eb6f2909d7c03e667cdbd80fe77bd5b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 23 May 2022 13:57:00 +0000 Subject: [PATCH 92/92] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 295a7d4c..00566c7e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1218,6 +1218,15 @@ "contributions": [ "content" ] + }, + { + "login": "bufo24", + "name": "Bufo", + "avatar_url": "https://avatars.githubusercontent.com/u/32884105?v=4", + "profile": "https://github.com/bufo24", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8,