From 4910bae10f057e7dbf75682062ea2c91ef608d7d Mon Sep 17 00:00:00 2001 From: rzrymiak <106121613+rzrymiak@users.noreply.github.com> Date: Mon, 18 Jul 2022 17:00:16 -0700 Subject: [PATCH 01/75] Update README.md Minor grammatical edit in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2387328..3e73934b 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Once you've completed Rustlings, put your new knowledge to good use! Continue pr ## Uninstalling Rustlings -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 +If you want to remove Rustlings from your system, there are two steps. First, you'll need to remove the exercises folder that the install script created for you: ```bash From 94bdb708fee17b6a87097cfbbcd697322c7a2141 Mon Sep 17 00:00:00 2001 From: Magnus Markling Date: Sun, 28 Aug 2022 15:10:29 +0200 Subject: [PATCH 02/75] Add quotes --- exercises/lifetimes/lifetimes1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/lifetimes/lifetimes1.rs b/exercises/lifetimes/lifetimes1.rs index 58e995c6..0236470d 100644 --- a/exercises/lifetimes/lifetimes1.rs +++ b/exercises/lifetimes/lifetimes1.rs @@ -22,5 +22,5 @@ fn main() { let string2 = "xyz"; let result = longest(string1.as_str(), string2); - println!("The longest string is {}", result); + println!("The longest string is '{}'", result); } From 291da61fda51c4bbb43e48997ede007b9f3a0251 Mon Sep 17 00:00:00 2001 From: Magnus Markling Date: Sun, 28 Aug 2022 15:12:15 +0200 Subject: [PATCH 03/75] Add quotes --- exercises/lifetimes/lifetimes2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/lifetimes/lifetimes2.rs b/exercises/lifetimes/lifetimes2.rs index c73a28ad..b48feabc 100644 --- a/exercises/lifetimes/lifetimes2.rs +++ b/exercises/lifetimes/lifetimes2.rs @@ -23,5 +23,5 @@ fn main() { let string2 = String::from("xyz"); result = longest(string1.as_str(), string2.as_str()); } - println!("The longest string is {}", result); + println!("The longest string is '{}'", result); } From c97e659d782fbd26337f52941aff9e0a66fabce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Raz=20Guzm=C3=A1n=20Macedo?= Date: Mon, 5 Sep 2022 10:18:45 -0500 Subject: [PATCH 04/75] typox fix --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 060643d7..6feeb186 100644 --- a/info.toml +++ b/info.toml @@ -943,7 +943,7 @@ After using drop() to move the Planets out of scope individually, the reference In the end the sun only has one reference again, to itself. See more at: https://doc.rust-lang.org/book/ch15-04-rc.html -* Unforunately Pluto is no longer considered a planet :( +* Unfortunately Pluto is no longer considered a planet :( """ [[exercises]] From 96552e07c20ef9ad6b2d64d6f853cb8ff1da1b01 Mon Sep 17 00:00:00 2001 From: liv Date: Tue, 6 Sep 2022 12:09:43 +0200 Subject: [PATCH 05/75] fix(quiz1): correct explanation once again --- exercises/quiz1.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index d1e76e59..3c2f8789 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -4,9 +4,11 @@ // - Functions // - If -// Mary is buying apples. One apple usually costs 2 Rustbucks, but if you buy -// 40 or more at once, each apple only costs 1! Write a function that calculates -// the price of an order of apples given the quantity bought. No hints this time! +// Mary is buying apples. The price of an apple is calculated as follows: +// - An apple costs 2 rustbucks. +// - If Mary buys more than 40 apples, each apple only costs 1 rustbuck! +// Write a function that calculates the price of an order of apples given +// the quantity bought. No hints this time! // I AM NOT DONE From 1d5700e58a6f55a5549dc217aa9c4d071cdf8d2e Mon Sep 17 00:00:00 2001 From: liv Date: Tue, 6 Sep 2022 12:10:53 +0200 Subject: [PATCH 06/75] fix(quiz1): add fourth assert --- exercises/quiz1.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/quiz1.rs b/exercises/quiz1.rs index 3c2f8789..dbb5cdc9 100644 --- a/exercises/quiz1.rs +++ b/exercises/quiz1.rs @@ -20,9 +20,11 @@ fn verify_test() { let price1 = calculate_price_of_apples(35); let price2 = calculate_price_of_apples(40); - let price3 = calculate_price_of_apples(65); + let price3 = calculate_price_of_apples(41); + let price4 = calculate_price_of_apples(65); assert_eq!(70, price1); assert_eq!(80, price2); - assert_eq!(65, price3); + assert_eq!(41, price3); + assert_eq!(65, price4); } From c9c743967f1a8b44407d44a86ffa0421d485dd39 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:13:26 +0000 Subject: [PATCH 07/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 8edf09bf..5dcace66 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -219,6 +219,9 @@ authors.
Gabriel Bianconi

πŸ–‹
Kody Low

πŸ–‹ + +
rzrymiak

πŸ–‹ + From f437f8e9eaa991063cf46a195a1319c11b15b412 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:13:27 +0000 Subject: [PATCH 08/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index f2033dcd..2da6a47f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1542,6 +1542,15 @@ "contributions": [ "content" ] + }, + { + "login": "rzrymiak", + "name": "rzrymiak", + "avatar_url": "https://avatars.githubusercontent.com/u/106121613?v=4", + "profile": "https://github.com/rzrymiak", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 900d58d05481847bb9968a612c35504533d20648 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:14:05 +0000 Subject: [PATCH 09/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 5dcace66..e038de0b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -221,6 +221,7 @@ authors.
rzrymiak

πŸ–‹ +
Miguel Raz GuzmΓ‘n Macedo

πŸ–‹ From 742200d14bb3552fc595aed8d2fdf80e2c6b2084 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:14:06 +0000 Subject: [PATCH 10/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2da6a47f..c7789419 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1551,6 +1551,15 @@ "contributions": [ "content" ] + }, + { + "login": "miguelraz", + "name": "Miguel Raz GuzmΓ‘n Macedo", + "avatar_url": "https://avatars.githubusercontent.com/u/13056181?v=4", + "profile": "https://github.com/miguelraz", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 7b5ef323c5d3ecb6cd16ff7172e45dae0c5d2360 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:17:07 +0000 Subject: [PATCH 11/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index e038de0b..29d330d2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -222,6 +222,7 @@ authors.
rzrymiak

πŸ–‹
Miguel Raz GuzmΓ‘n Macedo

πŸ–‹ +
Magnus Markling

πŸ–‹ From 50323a3977f5e8f9a99da9413413514d077863ff Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:17:08 +0000 Subject: [PATCH 12/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index c7789419..0917089a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1560,6 +1560,15 @@ "contributions": [ "content" ] + }, + { + "login": "memark", + "name": "Magnus Markling", + "avatar_url": "https://avatars.githubusercontent.com/u/318504?v=4", + "profile": "https://github.com/memark", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From c923e7af73a91970d2e63e03babbca9cc0817551 Mon Sep 17 00:00:00 2001 From: mokou Date: Tue, 6 Sep 2022 12:22:17 +0200 Subject: [PATCH 13/75] chore: release 5.2.1 --- CHANGELOG.md | 14 ++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 ++-- src/main.rs | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b15cf99..9925e3db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ + +## 5.2.1 (2022-09-06) + +#### Fixed + +- **quiz1**: Reworded the comment to actually reflect what's going on in the tests. + Also added another assert just to make sure. +- **rc1**: Fixed a typo in the hint. +- **lifetimes**: Add quotes to the `println!` output, for readability. + +#### Housekeeping + +- Fixed a typo in README.md + ## 5.2.0 (2022-08-27) diff --git a/Cargo.lock b/Cargo.lock index 2370e8dc..948d0f42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -459,7 +459,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rustlings" -version = "5.1.1" +version = "5.2.1" dependencies = [ "argh", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 25cd7bfe..dadded68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustlings" -version = "5.2.0" +version = "5.2.1" authors = ["Liv ", "Carol (Nichols || Goulding) "] edition = "2021" diff --git a/README.md b/README.md index 39a31c96..9b619d6f 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ If you get a permission denied message, you might have to exclude the directory Basically: Clone the repository at the latest tag, run `cargo install --path .`. ```bash -# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.1.1) -git clone -b 5.1.1 --depth 1 https://github.com/rust-lang/rustlings +# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.2.1) +git clone -b 5.2.1 --depth 1 https://github.com/rust-lang/rustlings cd rustlings cargo install --force --path . ``` diff --git a/src/main.rs b/src/main.rs index 8eebc086..cd79d9ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ mod run; mod verify; // In sync with crate version -const VERSION: &str = "5.2.0"; +const VERSION: &str = "5.2.1"; #[derive(FromArgs, PartialEq, Debug)] /// Rustlings is a collection of small exercises to get you used to writing and reading Rust code From 34ed2358855e187990636621fdd6e435308532e3 Mon Sep 17 00:00:00 2001 From: Arkid <39987510+aaarkid@users.noreply.github.com> Date: Fri, 9 Sep 2022 02:40:22 +0200 Subject: [PATCH 14/75] fix: Add a deref in the test code It's virtually impossible to write a the `num_sq` function to take the Box since it doesn't implement `MulAssign`. --- exercises/conversions/as_ref_mut.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/conversions/as_ref_mut.rs b/exercises/conversions/as_ref_mut.rs index 9f479739..dafbdb98 100644 --- a/exercises/conversions/as_ref_mut.rs +++ b/exercises/conversions/as_ref_mut.rs @@ -54,7 +54,7 @@ mod tests { #[test] fn mult_box() { let mut num: Box = Box::new(3); - num_sq(&mut num); + num_sq(&mut *num); assert_eq!(*num, 9); } } From 68fe97bbc23d33b7cb2be5439711029c2e4826c0 Mon Sep 17 00:00:00 2001 From: Tiago De Gaspari <3237254+gasparitiago@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:53:59 -0300 Subject: [PATCH 15/75] fix(quiz2): fix comment regarding hints Change the comment on quiz2.rs, since there are no hints. --- exercises/quiz2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/quiz2.rs b/exercises/quiz2.rs index d8fa954a..606d3c70 100644 --- a/exercises/quiz2.rs +++ b/exercises/quiz2.rs @@ -16,7 +16,7 @@ // - The input is going to be a Vector of a 2-length tuple, // the first element is the string, the second one is the command. // - The output element is going to be a Vector of strings. -// Execute `rustlings hint quiz2` or use the `hint` watch subcommand for a hint. +// No hints this time! // I AM NOT DONE From d3c0c18946b56223d5282587c3adb51959f14588 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 08:11:12 +0000 Subject: [PATCH 16/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 433 +++++++++++++++++++++++++++-------------------------- 1 file changed, 218 insertions(+), 215 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 29d330d2..43e11b1a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -9,221 +9,224 @@ 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

πŸ’»

Kisaragi

πŸ“–

Lucas Aries

πŸ–‹

ragreenburg

πŸ–‹

stevenfukase

πŸ–‹

J-S-Kim

πŸ–‹

Fointard

πŸ–‹

Ryan Lowe

πŸ’»

cui fliter

πŸ–‹

Ron Lusk

πŸ–‹

Bryan Lee

πŸ–‹

Nandaja Varma

πŸ“–

pwygab

πŸ’»

Lucas Grigolon Varela

πŸ–‹

Bufo

πŸ–‹

Jack Clayton

πŸ’»

Konstantin

πŸ–‹

0pling

πŸ–‹

KatanaFluorescent

πŸ’»

Drew Morris

πŸ’»

camperdue42

πŸ–‹

YsuOS

πŸ–‹

Steven Nguyen

πŸ–‹

nacairns1

πŸ–‹

Paulo Gabriel Justino Bezerra

πŸ–‹

Jason

πŸ–‹

exdx

πŸ–‹

James Zow

πŸ–‹

James Bromley

πŸ–‹

swhiteCQC

πŸ–‹

Neil Pate

πŸ–‹

wojexe

πŸ–‹

Mattia Schiavon

πŸ–‹

Eric Jolibois

πŸ–‹

Edwin Chang

πŸ–‹

Saikat Das

πŸ–‹

Jeremy Goh

πŸ–‹

Lioness100

πŸ–‹

Tristan Nicholls

πŸ–‹

Claire

πŸ–‹

Maurice Van Wassenhove

πŸ–‹

John Mendelewski

πŸ’»

Brian Fakhoury

πŸ–‹

Markus Boehme

πŸ’»

Nico Vromans

πŸ–‹

vostok92

πŸ–‹

Magnus RΓΈdseth

πŸ–‹

rubiesonthesky

πŸ–‹

Gabriel Bianconi

πŸ–‹

Kody Low

πŸ–‹

rzrymiak

πŸ–‹

Miguel Raz GuzmΓ‘n Macedo

πŸ–‹

Magnus Markling

πŸ–‹

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

πŸ’»

Kisaragi

πŸ“–

Lucas Aries

πŸ–‹

ragreenburg

πŸ–‹

stevenfukase

πŸ–‹

J-S-Kim

πŸ–‹

Fointard

πŸ–‹

Ryan Lowe

πŸ’»

cui fliter

πŸ–‹

Ron Lusk

πŸ–‹

Bryan Lee

πŸ–‹

Nandaja Varma

πŸ“–

pwygab

πŸ’»

Lucas Grigolon Varela

πŸ–‹

Bufo

πŸ–‹

Jack Clayton

πŸ’»

Konstantin

πŸ–‹

0pling

πŸ–‹

KatanaFluorescent

πŸ’»

Drew Morris

πŸ’»

camperdue42

πŸ–‹

YsuOS

πŸ–‹

Steven Nguyen

πŸ–‹

nacairns1

πŸ–‹

Paulo Gabriel Justino Bezerra

πŸ–‹

Jason

πŸ–‹

exdx

πŸ–‹

James Zow

πŸ–‹

James Bromley

πŸ–‹

swhiteCQC

πŸ–‹

Neil Pate

πŸ–‹

wojexe

πŸ–‹

Mattia Schiavon

πŸ–‹

Eric Jolibois

πŸ–‹

Edwin Chang

πŸ–‹

Saikat Das

πŸ–‹

Jeremy Goh

πŸ–‹

Lioness100

πŸ–‹

Tristan Nicholls

πŸ–‹

Claire

πŸ–‹

Maurice Van Wassenhove

πŸ–‹

John Mendelewski

πŸ’»

Brian Fakhoury

πŸ–‹

Markus Boehme

πŸ’»

Nico Vromans

πŸ–‹

vostok92

πŸ–‹

Magnus RΓΈdseth

πŸ–‹

rubiesonthesky

πŸ–‹

Gabriel Bianconi

πŸ–‹

Kody Low

πŸ–‹

rzrymiak

πŸ–‹

Miguel Raz GuzmΓ‘n Macedo

πŸ–‹

Magnus Markling

πŸ–‹

Tiago De Gaspari

πŸ–‹
From 072847943af3884ce0ae21dc594649a86be54e2e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 08:11:13 +0000 Subject: [PATCH 17/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0917089a..a5a6dd60 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1569,6 +1569,15 @@ "contributions": [ "content" ] + }, + { + "login": "gasparitiago", + "name": "Tiago De Gaspari", + "avatar_url": "https://avatars.githubusercontent.com/u/3237254?v=4", + "profile": "https://github.com/gasparitiago", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, @@ -1576,5 +1585,6 @@ "projectOwner": "rust-lang", "repoType": "github", "repoHost": "https://github.com", - "skipCi": true + "skipCi": true, + "commitConvention": "angular" } From 3028d1395cfa1bc2dbf49f7678d8f083e9042a56 Mon Sep 17 00:00:00 2001 From: skaunov <65976143+skaunov@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:33:03 +0300 Subject: [PATCH 18/75] Add link to `std` in `strings3` hint Seems like it's the first place, where `std` is introduced in Rustlings, and it's a good place to facilitate docs discovery for user. As _the book_ seems to have no Rustlings-sized solutions for this exercise. --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 6feeb186..e80d8a9c 100644 --- a/info.toml +++ b/info.toml @@ -449,7 +449,7 @@ path = "exercises/strings/strings3.rs" mode = "test" hint = """ There's tons of useful standard library functions for strings. Let's try and use some of -them! +them: ! For the compose_me method: You can either use the `format!` macro, or convert the string slice into an owned string, which you can then freely extend.""" From 3375b67b2b72a25960aa9e37612f8f1d3d2c05b2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:29:14 +0000 Subject: [PATCH 19/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 43e11b1a..9f63f5dd 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -225,6 +225,7 @@ authors.
Miguel Raz GuzmΓ‘n Macedo

πŸ–‹
Magnus Markling

πŸ–‹
Tiago De Gaspari

πŸ–‹ +
skaunov

πŸ–‹ From 37a734421992deab8e15286245e4429919d3a93d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:29:15 +0000 Subject: [PATCH 20/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index a5a6dd60..4fd4b1d5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1578,6 +1578,15 @@ "contributions": [ "content" ] + }, + { + "login": "skaunov", + "name": "skaunov", + "avatar_url": "https://avatars.githubusercontent.com/u/65976143?v=4", + "profile": "https://github.com/skaunov", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From c0b3194a55da75c6404944e01f032c2a92ea5b0c Mon Sep 17 00:00:00 2001 From: skaunov <65976143+skaunov@users.noreply.github.com> Date: Sat, 17 Sep 2022 00:26:05 +0300 Subject: [PATCH 21/75] Correct a link in `threads1` `hint` It didn't work without last character --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index e80d8a9c..263b23eb 100644 --- a/info.toml +++ b/info.toml @@ -969,7 +969,7 @@ https://doc.rust-lang.org/std/thread/fn.spawn.html A challenge with multi-threaded applications is that the main thread can finish before the spawned threads are completed. -https://doc.rust-lang.org/book/ch16-01-threads.html#waiting-for-all-threads-to-finish-using-join-handle +https://doc.rust-lang.org/book/ch16-01-threads.html#waiting-for-all-threads-to-finish-using-join-handles Collect the JoinHandles and wait for them to finish. https://doc.rust-lang.org/std/thread/struct.JoinHandle.html From efdebd48b6239b29d69d684fae575ca738cacf41 Mon Sep 17 00:00:00 2001 From: Cal Jacobson Date: Sun, 25 Sep 2022 15:22:15 -0500 Subject: [PATCH 22/75] improve hint for iterators1 --- info.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info.toml b/info.toml index e80d8a9c..acc9fc3e 100644 --- a/info.toml +++ b/info.toml @@ -818,9 +818,9 @@ Step 1: We need to apply something to the collection `my_fav_fruits` before we start to go through it. What could that be? Take a look at the struct definition for a vector for inspiration: https://doc.rust-lang.org/std/vec/struct.Vec.html. -Step 2 & step 2.1: +Step 2 & step 3: Very similar to the lines above and below. You've got this! -Step 3: +Step 4: An iterator goes through all elements in a collection, but what if we've run out of elements? What should we expect here? If you're stuck, take a look at https://doc.rust-lang.org/std/iter/trait.Iterator.html for some ideas. From 1660f1647eb16692f5dd1367395416c9b261848d Mon Sep 17 00:00:00 2001 From: Tostapunk Date: Wed, 28 Sep 2022 23:40:00 +0200 Subject: [PATCH 23/75] fix: Fix typo in errors5 hint fixes #1205 --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index e80d8a9c..ecf307d7 100644 --- a/info.toml +++ b/info.toml @@ -627,7 +627,7 @@ propagated using `?` operators. How do we declare a return type from `main()` th Under the hood, the `?` operator calls `From::from` on the error value to convert it to a boxed trait object, a `Box`. This boxed trait object is polymorphic, and since all -errors implement the `error:Error` trait, we can capture lots of different errors in one "Box" +errors implement the `error::Error` trait, we can capture lots of different errors in one "Box" object. Check out this section of the book: From 58cba835f2d79665a11017483d5df7c62c5c1607 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 08:45:06 +0000 Subject: [PATCH 24/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 350 +++++++++++++++++++++++++++-------------------------- 1 file changed, 177 insertions(+), 173 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 9f63f5dd..bfc8b99a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -11,223 +11,227 @@ authors. - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + + + + +

Carol (Nichols || Goulding)

πŸ’» πŸ–‹

QuietMisdreavus

πŸ’» πŸ–‹

Robert M Lugg

πŸ–‹

Hynek Schlawack

πŸ’»

Katharina Fey

πŸ’»

lukabavdaz

πŸ’» πŸ–‹

Erik Vesteraas

πŸ’»

delet0r

πŸ’»
Carol (Nichols || Goulding)
Carol (Nichols || Goulding)

πŸ’» πŸ–‹
QuietMisdreavus
QuietMisdreavus

πŸ’» πŸ–‹
Robert M Lugg
Robert M Lugg

πŸ–‹
Hynek Schlawack
Hynek Schlawack

πŸ’»
Katharina Fey
Katharina Fey

πŸ’»
lukabavdaz
lukabavdaz

πŸ’» πŸ–‹
Erik Vesteraas
Erik Vesteraas

πŸ’»
delet0r
delet0r

πŸ’»

Shaun Bennett

πŸ’»

Andrew Bagshaw

πŸ’»

Kyle Isom

πŸ’»

Colin Pitrat

πŸ’»

Zac Anger

πŸ’»

Matthias Geier

πŸ’»

Chris Pearce

πŸ’»

Yvan Sraka

πŸ’»
Shaun Bennett
Shaun Bennett

πŸ’»
Andrew Bagshaw
Andrew Bagshaw

πŸ’»
Kyle Isom
Kyle Isom

πŸ’»
Colin Pitrat
Colin Pitrat

πŸ’»
Zac Anger
Zac Anger

πŸ’»
Matthias Geier
Matthias Geier

πŸ’»
Chris Pearce
Chris Pearce

πŸ’»
Yvan Sraka
Yvan Sraka

πŸ’»

Denys Smirnov

πŸ’»

eddyp

πŸ’»

Brian Kung

πŸ’» πŸ–‹

Russell

πŸ’»

Dan Wilhelm

πŸ“–

Jesse

πŸ’» πŸ–‹

Fredrik JambrΓ©n

πŸ’»

Pete McFarlane

πŸ–‹
Denys Smirnov
Denys Smirnov

πŸ’»
eddyp
eddyp

πŸ’»
Brian Kung
Brian Kung

πŸ’» πŸ–‹
Russell
Russell

πŸ’»
Dan Wilhelm
Dan Wilhelm

πŸ“–
Jesse
Jesse

πŸ’» πŸ–‹
Fredrik JambrΓ©n
Fredrik JambrΓ©n

πŸ’»
Pete McFarlane
Pete McFarlane

πŸ–‹

nkanderson

πŸ’» πŸ–‹

Ajax M

πŸ“–

Dylan Nugent

πŸ–‹

vyaslav

πŸ’» πŸ–‹

George

πŸ’»

Thomas Holloway

πŸ’» πŸ–‹

Jubilee

πŸ’»

WofWca

πŸ’»
nkanderson
nkanderson

πŸ’» πŸ–‹
Ajax M
Ajax M

πŸ“–
Dylan Nugent
Dylan Nugent

πŸ–‹
vyaslav
vyaslav

πŸ’» πŸ–‹
George
George

πŸ’»
Thomas Holloway
Thomas Holloway

πŸ’» πŸ–‹
Jubilee
Jubilee

πŸ’»
WofWca
WofWca

πŸ’»

Roberto Vidal

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

Jens

πŸ“–

Rahat Ahmed

πŸ“–

Abdou Seck

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

Katie

πŸ’»

Socrates

πŸ“–

gnodarse

πŸ–‹

Harrison Metzger

πŸ’»
Roberto Vidal
Roberto Vidal

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

πŸ“–
Rahat Ahmed
Rahat Ahmed

πŸ“–
Abdou Seck
Abdou Seck

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

πŸ’»
Socrates
Socrates

πŸ“–
gnodarse
gnodarse

πŸ–‹
Harrison Metzger
Harrison Metzger

πŸ’»

Torben Jonas

πŸ’» πŸ–‹

Paul Bissex

πŸ“–

Steven Mann

πŸ’» πŸ–‹

Mario Reder

πŸ’» πŸ–‹

skim

πŸ’»

Sanjay K

πŸ’» πŸ–‹

Rohan Jain

πŸ’»

Said Aspen

πŸ’» πŸ–‹
Torben Jonas
Torben Jonas

πŸ’» πŸ–‹
Paul Bissex
Paul Bissex

πŸ“–
Steven Mann
Steven Mann

πŸ’» πŸ–‹
Mario Reder
Mario Reder

πŸ’» πŸ–‹
skim
skim

πŸ’»
Sanjay K
Sanjay K

πŸ’» πŸ–‹
Rohan Jain
Rohan Jain

πŸ’»
Said Aspen
Said Aspen

πŸ’» πŸ–‹

Ufuk Celebi

πŸ’»

lebedevsergey

πŸ“–

Aleksei Trifonov

πŸ–‹

Darren Meehan

πŸ–‹

Jihchi Lee

πŸ–‹

Christofer Bertonha

πŸ–‹

Vivek Bharath Akupatni

πŸ’» ⚠️

DΓ­dac SementΓ© FernΓ‘ndez

πŸ’» πŸ–‹
Ufuk Celebi
Ufuk Celebi

πŸ’»
lebedevsergey
lebedevsergey

πŸ“–
Aleksei Trifonov
Aleksei Trifonov

πŸ–‹
Darren Meehan
Darren Meehan

πŸ–‹
Jihchi Lee
Jihchi Lee

πŸ–‹
Christofer Bertonha
Christofer Bertonha

πŸ–‹
Vivek Bharath Akupatni
Vivek Bharath Akupatni

πŸ’» ⚠️
DΓ­dac SementΓ© FernΓ‘ndez
DΓ­dac SementΓ© FernΓ‘ndez

πŸ’» πŸ–‹

Rob Story

πŸ’»

Siobhan Jacobson

πŸ’»

Evan Carroll

πŸ–‹

Jawaad Mahmood

πŸ–‹

Gaurang Tandon

πŸ–‹

Stefan Kupresak

πŸ–‹

Greg Leonard

πŸ–‹

Ryan McQuen

πŸ’»
Rob Story
Rob Story

πŸ’»
Siobhan Jacobson
Siobhan Jacobson

πŸ’»
Evan Carroll
Evan Carroll

πŸ–‹
Jawaad Mahmood
Jawaad Mahmood

πŸ–‹
Gaurang Tandon
Gaurang Tandon

πŸ–‹
Stefan Kupresak
Stefan Kupresak

πŸ–‹
Greg Leonard
Greg Leonard

πŸ–‹
Ryan McQuen
Ryan McQuen

πŸ’»

Annika

πŸ‘€

Axel Viala

πŸ’»

Mohammed Sazid Al Rashid

πŸ–‹ πŸ’»

Caleb Webber

🚧

Peter N

🚧

seancad

🚧

Will Hayworth

πŸ–‹

Christian Zeller

πŸ–‹
Annika
Annika

πŸ‘€
Axel Viala
Axel Viala

πŸ’»
Mohammed Sazid Al Rashid
Mohammed Sazid Al Rashid

πŸ–‹ πŸ’»
Caleb Webber
Caleb Webber

🚧
Peter N
Peter N

🚧
seancad
seancad

🚧
Will Hayworth
Will Hayworth

πŸ–‹
Christian Zeller
Christian Zeller

πŸ–‹

Jean-Francois Chevrette

πŸ–‹ πŸ’»

John Baber-Lucero

πŸ–‹

Tal

πŸ–‹

apogeeoak

πŸ–‹ πŸ’»

Larry Garfield

πŸ–‹

circumspect

πŸ–‹

Cyrus Wyett

πŸ–‹

cadolphs

πŸ’»
Jean-Francois Chevrette
Jean-Francois Chevrette

πŸ–‹ πŸ’»
John Baber-Lucero
John Baber-Lucero

πŸ–‹
Tal
Tal

πŸ–‹
apogeeoak
apogeeoak

πŸ–‹ πŸ’»
Larry Garfield
Larry Garfield

πŸ–‹
circumspect
circumspect

πŸ–‹
Cyrus Wyett
Cyrus Wyett

πŸ–‹
cadolphs
cadolphs

πŸ’»

Pascal H.

πŸ–‹

Rod Elias

πŸ–‹

Matt Lebl

πŸ’»

Ignacio Le Fluk

πŸ–‹

Taylor Yu

πŸ’» πŸ–‹

Patrick Hintermayer

πŸ’»

Pete Pavlovski

πŸ–‹

k12ish

πŸ–‹
Pascal H.
Pascal H.

πŸ–‹
Rod Elias
Rod Elias

πŸ–‹
Matt Lebl
Matt Lebl

πŸ’»
Ignacio Le Fluk
Ignacio Le Fluk

πŸ–‹
Taylor Yu
Taylor Yu

πŸ’» πŸ–‹
Patrick Hintermayer
Patrick Hintermayer

πŸ’»
Pete Pavlovski
Pete Pavlovski

πŸ–‹
k12ish
k12ish

πŸ–‹

Shao Yang Hong

πŸ–‹

Brandon Macer

πŸ–‹

Stoian Dan

πŸ–‹

Pi Delport

πŸ–‹

Sateesh

πŸ’» πŸ–‹

ZC

πŸ–‹

hyperparabolic

πŸ’»

arlecchino

πŸ“–
Shao Yang Hong
Shao Yang Hong

πŸ–‹
Brandon Macer
Brandon Macer

πŸ–‹
Stoian Dan
Stoian Dan

πŸ–‹
Pi Delport
Pi Delport

πŸ–‹
Sateesh
Sateesh

πŸ’» πŸ–‹
ZC
ZC

πŸ–‹
hyperparabolic
hyperparabolic

πŸ’»
arlecchino
arlecchino

πŸ“–

Richthofen

πŸ’»

Ivan Nerazumov

πŸ“–

lauralindzey

πŸ“–

Rakshit Sinha

πŸ–‹

Damian

πŸ–‹

Ben Armstead

πŸ’»

anuk909

πŸ–‹ πŸ’»

granddaifuku

πŸ–‹
Richthofen
Richthofen

πŸ’»
Ivan Nerazumov
Ivan Nerazumov

πŸ“–
lauralindzey
lauralindzey

πŸ“–
Rakshit Sinha
Rakshit Sinha

πŸ–‹
Damian
Damian

πŸ–‹
Ben Armstead
Ben Armstead

πŸ’»
anuk909
anuk909

πŸ–‹ πŸ’»
granddaifuku
granddaifuku

πŸ–‹

Weilet

πŸ–‹

LIU JIE

πŸ–‹

Antoine BΓΌsch

πŸ’»

frogtd

πŸ–‹

Zhenghao Lu

πŸ–‹

Fredrik Enestad

πŸ–‹

xuesong

πŸ–‹

Michael Walsh

πŸ’»
Weilet
Weilet

πŸ–‹
LIU JIE
LIU JIE

πŸ–‹
Antoine BΓΌsch
Antoine BΓΌsch

πŸ’»
frogtd
frogtd

πŸ–‹
Zhenghao Lu
Zhenghao Lu

πŸ–‹
Fredrik Enestad
Fredrik Enestad

πŸ–‹
xuesong
xuesong

πŸ–‹
Michael Walsh
Michael Walsh

πŸ’»

alirezaghey

πŸ–‹

Franklin van Nes

πŸ’»

nekonako

πŸ’»

ZX

πŸ–‹

Yang Wen

πŸ–‹

Brandon High

πŸ“–

x-hgg-x

πŸ’»

Kisaragi

πŸ“–
alirezaghey
alirezaghey

πŸ–‹
Franklin van Nes
Franklin van Nes

πŸ’»
nekonako
nekonako

πŸ’»
ZX
ZX

πŸ–‹
Yang Wen
Yang Wen

πŸ–‹
Brandon High
Brandon High

πŸ“–
x-hgg-x
x-hgg-x

πŸ’»
Kisaragi
Kisaragi

πŸ“–

Lucas Aries

πŸ–‹

ragreenburg

πŸ–‹

stevenfukase

πŸ–‹

J-S-Kim

πŸ–‹

Fointard

πŸ–‹

Ryan Lowe

πŸ’»

cui fliter

πŸ–‹

Ron Lusk

πŸ–‹
Lucas Aries
Lucas Aries

πŸ–‹
ragreenburg
ragreenburg

πŸ–‹
stevenfukase
stevenfukase

πŸ–‹
J-S-Kim
J-S-Kim

πŸ–‹
Fointard
Fointard

πŸ–‹
Ryan Lowe
Ryan Lowe

πŸ’»
cui fliter
cui fliter

πŸ–‹
Ron Lusk
Ron Lusk

πŸ–‹

Bryan Lee

πŸ–‹

Nandaja Varma

πŸ“–

pwygab

πŸ’»

Lucas Grigolon Varela

πŸ–‹

Bufo

πŸ–‹

Jack Clayton

πŸ’»

Konstantin

πŸ–‹

0pling

πŸ–‹
Bryan Lee
Bryan Lee

πŸ–‹
Nandaja Varma
Nandaja Varma

πŸ“–
pwygab
pwygab

πŸ’»
Lucas Grigolon Varela
Lucas Grigolon Varela

πŸ–‹
Bufo
Bufo

πŸ–‹
Jack Clayton
Jack Clayton

πŸ’»
Konstantin
Konstantin

πŸ–‹
0pling
0pling

πŸ–‹

KatanaFluorescent

πŸ’»

Drew Morris

πŸ’»

camperdue42

πŸ–‹

YsuOS

πŸ–‹

Steven Nguyen

πŸ–‹

nacairns1

πŸ–‹

Paulo Gabriel Justino Bezerra

πŸ–‹

Jason

πŸ–‹
KatanaFluorescent
KatanaFluorescent

πŸ’»
Drew Morris
Drew Morris

πŸ’»
camperdue42
camperdue42

πŸ–‹
YsuOS
YsuOS

πŸ–‹
Steven Nguyen
Steven Nguyen

πŸ–‹
nacairns1
nacairns1

πŸ–‹
Paulo Gabriel Justino Bezerra
Paulo Gabriel Justino Bezerra

πŸ–‹
Jason
Jason

πŸ–‹

exdx

πŸ–‹

James Zow

πŸ–‹

James Bromley

πŸ–‹

swhiteCQC

πŸ–‹

Neil Pate

πŸ–‹

wojexe

πŸ–‹

Mattia Schiavon

πŸ–‹

Eric Jolibois

πŸ–‹
exdx
exdx

πŸ–‹
James Zow
James Zow

πŸ–‹
James Bromley
James Bromley

πŸ–‹
swhiteCQC
swhiteCQC

πŸ–‹
Neil Pate
Neil Pate

πŸ–‹
wojexe
wojexe

πŸ–‹
Mattia Schiavon
Mattia Schiavon

πŸ–‹
Eric Jolibois
Eric Jolibois

πŸ–‹

Edwin Chang

πŸ–‹

Saikat Das

πŸ–‹

Jeremy Goh

πŸ–‹

Lioness100

πŸ–‹

Tristan Nicholls

πŸ–‹

Claire

πŸ–‹

Maurice Van Wassenhove

πŸ–‹

John Mendelewski

πŸ’»
Edwin Chang
Edwin Chang

πŸ–‹
Saikat Das
Saikat Das

πŸ–‹
Jeremy Goh
Jeremy Goh

πŸ–‹
Lioness100
Lioness100

πŸ–‹
Tristan Nicholls
Tristan Nicholls

πŸ–‹
Claire
Claire

πŸ–‹
Maurice Van Wassenhove
Maurice Van Wassenhove

πŸ–‹
John Mendelewski
John Mendelewski

πŸ’»

Brian Fakhoury

πŸ–‹

Markus Boehme

πŸ’»

Nico Vromans

πŸ–‹

vostok92

πŸ–‹

Magnus RΓΈdseth

πŸ–‹

rubiesonthesky

πŸ–‹

Gabriel Bianconi

πŸ–‹

Kody Low

πŸ–‹
Brian Fakhoury
Brian Fakhoury

πŸ–‹
Markus Boehme
Markus Boehme

πŸ’»
Nico Vromans
Nico Vromans

πŸ–‹
vostok92
vostok92

πŸ–‹
Magnus RΓΈdseth
Magnus RΓΈdseth

πŸ–‹
rubiesonthesky
rubiesonthesky

πŸ–‹
Gabriel Bianconi
Gabriel Bianconi

πŸ–‹
Kody Low
Kody Low

πŸ–‹

rzrymiak

πŸ–‹

Miguel Raz GuzmΓ‘n Macedo

πŸ–‹

Magnus Markling

πŸ–‹

Tiago De Gaspari

πŸ–‹

skaunov

πŸ–‹
rzrymiak
rzrymiak

πŸ–‹
Miguel Raz GuzmΓ‘n Macedo
Miguel Raz GuzmΓ‘n Macedo

πŸ–‹
Magnus Markling
Magnus Markling

πŸ–‹
Tiago De Gaspari
Tiago De Gaspari

πŸ–‹
skaunov
skaunov

πŸ–‹
Cal Jacobson
Cal Jacobson

πŸ–‹
From a59e305665f0cb52f29cc77f76cf09f6f3acae03 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 08:45:07 +0000 Subject: [PATCH 25/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4fd4b1d5..76dd3ad7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1587,6 +1587,15 @@ "contributions": [ "content" ] + }, + { + "login": "cj81499", + "name": "Cal Jacobson", + "avatar_url": "https://avatars.githubusercontent.com/u/9152032?v=4", + "profile": "http://caljacobson.dev", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From b4c7507b4d979c5c14870045e148afb6cec83103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Faug=C3=A8re?= Date: Fri, 30 Sep 2022 15:50:45 +0200 Subject: [PATCH 26/75] feat: Add VSCode extension recommendation --- .gitignore | 3 ++- .vscode/extensions.json | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json diff --git a/.gitignore b/.gitignore index 534453bc..c14f9227 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ exercises/clippy/Cargo.toml exercises/clippy/Cargo.lock rust-project.json .idea -.vscode +.vscode/* +!.vscode/extensions.json *.iml *.o diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..b85de749 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "rust-lang.rust-analyzer" + ] +} From 4749768734fd14e38eea555034f3586c11280933 Mon Sep 17 00:00:00 2001 From: Duchoud Nicolas <34117620+duchonic@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:36:18 +0200 Subject: [PATCH 27/75] additional test for fees --- exercises/structs/structs3.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/structs/structs3.rs b/exercises/structs/structs3.rs index 0b3615f4..4c2a6610 100644 --- a/exercises/structs/structs3.rs +++ b/exercises/structs/structs3.rs @@ -78,5 +78,6 @@ mod tests { let package = Package::new(sender_country, recipient_country, 1500); assert_eq!(package.get_fees(cents_per_gram), 4500); + assert_eq!(package.get_fees(cents_per_gram*2), 9000); } } From 76392d81fa2689d22ccf8dc0cf774e8d345cb80d Mon Sep 17 00:00:00 2001 From: Duchoud Nicolas <34117620+duchonic@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:43:23 +0200 Subject: [PATCH 28/75] Added spaces around * --- 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 4c2a6610..3536a457 100644 --- a/exercises/structs/structs3.rs +++ b/exercises/structs/structs3.rs @@ -78,6 +78,6 @@ mod tests { let package = Package::new(sender_country, recipient_country, 1500); assert_eq!(package.get_fees(cents_per_gram), 4500); - assert_eq!(package.get_fees(cents_per_gram*2), 9000); + assert_eq!(package.get_fees(cents_per_gram * 2), 9000); } } From 1e1b689775b01c0b5fb7d63d26b2d29898d4ab87 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:29:27 +0000 Subject: [PATCH 29/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index bfc8b99a..abd0d185 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -227,11 +227,9 @@ authors. Tiago De Gaspari
Tiago De Gaspari

πŸ–‹ skaunov
skaunov

πŸ–‹ Cal Jacobson
Cal Jacobson

πŸ–‹ + Duchoud Nicolas
Duchoud Nicolas

πŸ–‹ - - - From 88a767f39a643f0240bc8e928327ffcbdaa0bad4 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:29:28 +0000 Subject: [PATCH 30/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 76dd3ad7..6deddfca 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1596,6 +1596,15 @@ "contributions": [ "content" ] + }, + { + "login": "duchonic", + "name": "Duchoud Nicolas", + "avatar_url": "https://avatars.githubusercontent.com/u/34117620?v=4", + "profile": "https://github.com/duchonic", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From bfdc1991a5244610992fd3633b36750d539ccabb Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:39:59 +0000 Subject: [PATCH 31/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index abd0d185..704021ab 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -228,6 +228,7 @@ authors. skaunov
skaunov

πŸ–‹ Cal Jacobson
Cal Jacobson

πŸ–‹ Duchoud Nicolas
Duchoud Nicolas

πŸ–‹ + GaΓ«tan FaugΓ¨re
Gaëtan Faugère

πŸ”§ From d00f7783db431ac918e2d56a54def3e6e7d7beb2 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:40:00 +0000 Subject: [PATCH 32/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6deddfca..7374951b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1605,6 +1605,15 @@ "contributions": [ "content" ] + }, + { + "login": "gfaugere", + "name": "GaΓ«tan FaugΓ¨re", + "avatar_url": "https://avatars.githubusercontent.com/u/11901979?v=4", + "profile": "https://github.com/gfaugere", + "contributions": [ + "tool" + ] } ], "contributorsPerLine": 8, From c157c53983d67d209e7ffc63896f9a9030f5154c Mon Sep 17 00:00:00 2001 From: bhbuehler <25541343+bhbuehler@users.noreply.github.com> Date: Tue, 11 Oct 2022 12:05:37 -0500 Subject: [PATCH 33/75] docs(options1): fix and clarify 24 hour time instruction --- exercises/options/options1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/options/options1.rs b/exercises/options/options1.rs index d1735c2f..1149af08 100644 --- a/exercises/options/options1.rs +++ b/exercises/options/options1.rs @@ -8,8 +8,8 @@ // all, so there'll be no more left :( // TODO: Return an Option! fn maybe_icecream(time_of_day: u16) -> Option { - // We use the 24-hour system here, so 10PM is a value of 22 - // The Option output should gracefully handle cases where time_of_day > 24. + // We use the 24-hour system here, so 10PM is a value of 22 and 12AM is a value of 0 + // The Option output should gracefully handle cases where time_of_day > 23. ??? } From 08df6224af229429598c7da027e3738781bb750b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:51:21 +0000 Subject: [PATCH 34/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 704021ab..8dd71163 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -230,6 +230,9 @@ authors. Duchoud Nicolas
Duchoud Nicolas

πŸ–‹ GaΓ«tan FaugΓ¨re
Gaëtan Faugère

πŸ”§ + + bhbuehler
bhbuehler

πŸ–‹ + From a50dcc97280644740939e64140bc313be7e5cb8a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:51:22 +0000 Subject: [PATCH 35/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7374951b..5235b389 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1614,6 +1614,15 @@ "contributions": [ "tool" ] + }, + { + "login": "bhbuehler", + "name": "bhbuehler", + "avatar_url": "https://avatars.githubusercontent.com/u/25541343?v=4", + "profile": "https://github.com/bhbuehler", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 2940ad059d7f0fa1dbcbed2a6c522ba3cbfd0ec7 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 12 Oct 2022 16:30:52 -0400 Subject: [PATCH 36/75] Apply uninlined-format-args clippy lint This lint should also be applied to the excersies, but I am not certain how to run it for all non-crate individual files. To re-run: ``` rustup run nightly cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args ``` --- src/exercise.rs | 2 +- src/main.rs | 22 +++++++++++----------- src/run.rs | 4 ++-- src/verify.rs | 14 +++++++------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/exercise.rs b/src/exercise.rs index 4be3a2cc..c0dae34e 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -20,7 +20,7 @@ fn temp_file() -> String { .filter(|c| c.is_alphanumeric()) .collect(); - format!("./temp_{}_{}", process::id(), thread_id) + format!("./temp_{}_{thread_id}", process::id()) } // The mode of the exercise. diff --git a/src/main.rs b/src/main.rs index cd79d9ff..3e78333a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -121,12 +121,12 @@ fn main() { let args: Args = argh::from_env(); if args.version { - println!("v{}", VERSION); + println!("v{VERSION}"); std::process::exit(0); } if args.nested.is_none() { - println!("\n{}\n", WELCOME); + println!("\n{WELCOME}\n"); } if !Path::new("info.toml").exists() { @@ -150,7 +150,7 @@ fn main() { let verbose = args.nocapture; let command = args.nested.unwrap_or_else(|| { - println!("{}\n", DEFAULT_OUT); + println!("{DEFAULT_OUT}\n"); std::process::exit(0); }); match command { @@ -179,11 +179,11 @@ fn main() { }; if solve_cond && (filter_cond || subargs.filter.is_none()) { let line = if subargs.paths { - format!("{}\n", fname) + format!("{fname}\n") } else if subargs.names { format!("{}\n", e.name) } else { - format!("{:<17}\t{:<46}\t{:<7}\n", e.name, fname, status) + format!("{:<17}\t{fname:<46}\t{status:<7}\n", e.name) }; // Somehow using println! leads to the binary panicking // when its output is piped. @@ -266,7 +266,7 @@ fn main() { "{emoji} All exercises completed! {emoji}", emoji = Emoji("πŸŽ‰", "β˜…") ); - println!("\n{}\n", FENISH_LINE); + println!("\n{FENISH_LINE}\n"); } Ok(WatchStatus::Unfinished) => { println!("We hope you're enjoying learning about Rust!"); @@ -289,7 +289,7 @@ fn spawn_watch_shell( let input = input.trim(); if input == "hint" { if let Some(hint) = &*failed_exercise_hint.lock().unwrap() { - println!("{}", hint); + println!("{hint}"); } } else if input == "clear" { println!("\x1B[2J\x1B[1;1H"); @@ -306,10 +306,10 @@ fn spawn_watch_shell( println!("Watch mode automatically re-evaluates the current exercise"); println!("when you edit a file's contents.") } else { - println!("unknown command: {}", input); + println!("unknown command: {input}"); } } - Err(error) => println!("error reading command: {}", error), + Err(error) => println!("error reading command: {error}"), } }); } @@ -329,7 +329,7 @@ fn find_exercise<'a>(name: &str, exercises: &'a [Exercise]) -> &'a Exercise { .iter() .find(|e| e.name == name) .unwrap_or_else(|| { - println!("No exercise found for '{}'!", name); + println!("No exercise found for '{name}'!"); std::process::exit(1) }) } @@ -392,7 +392,7 @@ fn watch(exercises: &[Exercise], verbose: bool) -> notify::Result { Err(RecvTimeoutError::Timeout) => { // the timeout expired, just check the `should_quit` variable below then loop again } - Err(e) => println!("watch error: {:?}", e), + Err(e) => println!("watch error: {e:?}"), } // Check if we need to exit if should_quit.load(Ordering::SeqCst) { diff --git a/src/run.rs b/src/run.rs index 826f00a6..1e2e56cf 100644 --- a/src/run.rs +++ b/src/run.rs @@ -35,7 +35,7 @@ pub fn reset(exercise: &Exercise) -> 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)); + progress_bar.set_message(format!("Compiling {exercise}...")); progress_bar.enable_steady_tick(100); let compilation_result = exercise.compile(); @@ -52,7 +52,7 @@ fn compile_and_run(exercise: &Exercise) -> Result<(), ()> { } }; - progress_bar.set_message(format!("Running {}...", exercise)); + 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 6f877831..95ccbe50 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -48,7 +48,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)); + progress_bar.set_message(format!("Compiling {exercise}...")); progress_bar.enable_steady_tick(100); let _ = compile(exercise, &progress_bar)?; @@ -60,12 +60,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)); + 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)); + progress_bar.set_message(format!("Running {exercise}...")); let result = compilation.run(); progress_bar.finish_and_clear(); @@ -86,7 +86,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)); + progress_bar.set_message(format!("Testing {exercise}...")); progress_bar.enable_steady_tick(100); let compilation = compile(exercise, &progress_bar)?; @@ -165,16 +165,16 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option) -> println!(); if no_emoji { - println!("~*~ {} ~*~", success_msg) + println!("~*~ {success_msg} ~*~") } else { - println!("πŸŽ‰ πŸŽ‰ {} πŸŽ‰ πŸŽ‰", success_msg) + println!("πŸŽ‰ πŸŽ‰ {success_msg} πŸŽ‰ πŸŽ‰") } println!(); if let Some(output) = prompt_output { println!("Output:"); println!("{}", separator()); - println!("{}", output); + println!("{output}"); println!("{}", separator()); println!(); } From 68388e5d4f73ca7717eff0e668aa89f5c3a2124e Mon Sep 17 00:00:00 2001 From: azzamsa Date: Mon, 3 Oct 2022 19:56:46 +0700 Subject: [PATCH 37/75] feat(verify): add progress percentage in watch mode --- src/main.rs | 2 +- src/verify.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index cd79d9ff..8a17a35f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -202,7 +202,7 @@ fn main() { }); let percentage_progress = exercises_done as f32 / exercises.len() as f32 * 100.0; println!( - "Progress: You completed {} / {} exercises ({:.2} %).", + "Progress: You completed {} / {} exercises ({:.1} %).", exercises_done, exercises.len(), percentage_progress diff --git a/src/verify.rs b/src/verify.rs index 6f877831..595990d2 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -16,7 +16,7 @@ pub fn verify<'a>( 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}") + .template("Progress: [{bar:60.green/red}] {pos}/{len} {msg}") .progress_chars("#>-") ); bar.set_position(num_done as u64); @@ -29,6 +29,8 @@ pub fn verify<'a>( if !compile_result.unwrap_or(false) { return Err(exercise); } + let percentage = num_done as f32 / total as f32 * 100.0; + bar.set_message(format!("({:.1} %)", percentage)); bar.inc(1); } Ok(()) From c96fbc71809e913cacde12a5859404490a2f783a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:26:50 +0000 Subject: [PATCH 38/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 8dd71163..3e7f916d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -232,6 +232,7 @@ authors. bhbuehler
bhbuehler

πŸ–‹ + Yuri Astrakhan
Yuri Astrakhan

πŸ’» From 8b251a202f09b24fa1c009e32b69bfa82d4ca75e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:26:51 +0000 Subject: [PATCH 39/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 5235b389..eaaf6244 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1623,6 +1623,15 @@ "contributions": [ "content" ] + }, + { + "login": "nyurik", + "name": "Yuri Astrakhan", + "avatar_url": "https://avatars.githubusercontent.com/u/1641515?v=4", + "profile": "https://github.com/nyurik", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From eea039b025c22e0103cea3cb980c985d6e0ff9b6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:30:47 +0000 Subject: [PATCH 40/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 3e7f916d..642659b2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -233,6 +233,7 @@ authors. bhbuehler
bhbuehler

πŸ–‹ Yuri Astrakhan
Yuri Astrakhan

πŸ’» + azzamsa
azzamsa

πŸ’» From 3cb9825033f1d77e51a769db0300a62b525dbb1b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:30:48 +0000 Subject: [PATCH 41/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index eaaf6244..208d52ef 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1632,6 +1632,15 @@ "contributions": [ "code" ] + }, + { + "login": "azzamsa", + "name": "azzamsa", + "avatar_url": "https://avatars.githubusercontent.com/u/17734314?v=4", + "profile": "http://azzamsa.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From ccd73c0a815bbf5bdb1d215e0e0417f5ea216e68 Mon Sep 17 00:00:00 2001 From: Matthew Van Schellebeeck Date: Sun, 16 Oct 2022 08:18:56 -0400 Subject: [PATCH 42/75] style: explicitly use Arc::clone --- exercises/threads/threads2.rs | 2 +- exercises/threads/threads3.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/threads/threads2.rs b/exercises/threads/threads2.rs index d0f8578f..ada3d14a 100644 --- a/exercises/threads/threads2.rs +++ b/exercises/threads/threads2.rs @@ -17,7 +17,7 @@ fn main() { let status = Arc::new(JobStatus { jobs_completed: 0 }); let mut handles = vec![]; for _ in 0..10 { - let status_shared = status.clone(); + let status_shared = Arc::clone(&status); let handle = thread::spawn(move || { thread::sleep(Duration::from_millis(250)); // TODO: You must take an action before you update a shared value diff --git a/exercises/threads/threads3.rs b/exercises/threads/threads3.rs index 27e99088..9e9f285a 100644 --- a/exercises/threads/threads3.rs +++ b/exercises/threads/threads3.rs @@ -26,8 +26,8 @@ impl Queue { fn send_tx(q: Queue, tx: mpsc::Sender) -> () { let qc = Arc::new(q); - let qc1 = qc.clone(); - let qc2 = qc.clone(); + let qc1 = Arc::clone(&qc); + let qc2 = Arc::clone(&qc); thread::spawn(move || { for val in &qc1.first_half { From 5e6207bb90919d71a68c852f1c46eb6f23b09c10 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:38:01 +0000 Subject: [PATCH 43/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 642659b2..0a21049d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -234,6 +234,7 @@ authors. bhbuehler
bhbuehler

πŸ–‹ Yuri Astrakhan
Yuri Astrakhan

πŸ’» azzamsa
azzamsa

πŸ’» + mvanschellebeeck
mvanschellebeeck

πŸ–‹ From 61c086b2429d7a7ea5d7aa98ddeaa6870b564a9b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:38:02 +0000 Subject: [PATCH 44/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 208d52ef..f46e1ade 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1641,6 +1641,15 @@ "contributions": [ "code" ] + }, + { + "login": "mvanschellebeeck", + "name": "mvanschellebeeck", + "avatar_url": "https://avatars.githubusercontent.com/u/17671052?v=4", + "profile": "https://github.com/mvanschellebeeck", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From a20452489720a59f4b080c6c241d8df1d0e06e75 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:39:49 +0000 Subject: [PATCH 45/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 0a21049d..b994508c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -235,6 +235,7 @@ authors. Yuri Astrakhan
Yuri Astrakhan

πŸ’» azzamsa
azzamsa

πŸ’» mvanschellebeeck
mvanschellebeeck

πŸ–‹ + Arkid
Arkid

πŸ–‹ From ee841311714ebb8baa1fe46e00281d00f38bf3ad Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 09:39:50 +0000 Subject: [PATCH 46/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index f46e1ade..6e9ece99 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1650,6 +1650,15 @@ "contributions": [ "content" ] + }, + { + "login": "aaarkid", + "name": "Arkid", + "avatar_url": "https://avatars.githubusercontent.com/u/39987510?v=4", + "profile": "https://github.com/aaarkid", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 623161e50dd8dc1960452c7e5bd7d66bfbab483f Mon Sep 17 00:00:00 2001 From: Arkid <39987510+aaarkid@users.noreply.github.com> Date: Fri, 21 Oct 2022 02:45:31 +0200 Subject: [PATCH 47/75] fix: Revert deref change Revert the addition of a deref in PR #1192 by me, which should not be there. Apologies for the inconvenience caused. --- exercises/conversions/as_ref_mut.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/conversions/as_ref_mut.rs b/exercises/conversions/as_ref_mut.rs index dafbdb98..c9eed7d0 100644 --- a/exercises/conversions/as_ref_mut.rs +++ b/exercises/conversions/as_ref_mut.rs @@ -17,7 +17,7 @@ fn char_counter(arg: T) -> usize { arg.as_ref().chars().count() } -// Squares a number using AsMut. Add the trait bound as is appropriate and +// Squares a number using as_mut(). Add the trait bound as is appropriate and // implement the function body. fn num_sq(arg: &mut T) { ??? @@ -54,7 +54,7 @@ mod tests { #[test] fn mult_box() { let mut num: Box = Box::new(3); - num_sq(&mut *num); + num_sq(&mut num); assert_eq!(*num, 9); } } From da995b24ebbc210b5fe22eef3c52fbdde89a9d01 Mon Sep 17 00:00:00 2001 From: Tom Kunc Date: Mon, 24 Oct 2022 13:57:44 +1100 Subject: [PATCH 48/75] feat(macros-readme): Add link to MacroKata --- exercises/macros/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/macros/README.md b/exercises/macros/README.md index 31a941b7..e34bc3a8 100644 --- a/exercises/macros/README.md +++ b/exercises/macros/README.md @@ -4,6 +4,10 @@ Rust's macro system is very powerful, but also kind of difficult to wrap your head around. We're not going to teach you how to write your own fully-featured macros. Instead, we'll show you how to use and create them. +If you'd like to learn more about writing your own macros, the +[macrokata](https://github.com/tfpk/macrokata) project has a similar style +of exercises to Rustlings, but is all about learning to write Macros. + ## Further information - [Macros](https://doc.rust-lang.org/book/ch19-06-macros.html) From 8e0f5bf1256e1485ea9f1d2ed81ad1059c21f2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Tue, 25 Jan 2022 11:47:16 +0100 Subject: [PATCH 49/75] feat: Add flake.nix for nix users Co-authored-by: Winter --- README.md | 13 ++++++++++++ flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 53 +++++++++++++++++++++++++++++++++++++++++++++++ shell.nix | 6 ++++++ 4 files changed, 132 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/README.md b/README.md index 9b619d6f..29f3e5de 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,19 @@ curl -L https://raw.githubusercontent.com/rust-lang/rustlings/main/install.sh | This will install Rustlings and give you access to the `rustlings` command. Run it to get started! +### Nix +Basically: Clone the repository at the latest tag, finally run `nix develop` or `nix-shell`. + +```bash +# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.2.1) +git clone -b 5.2.1 --depth 1 https://github.com/rust-lang/rustlings +cd rustlings +# if nix version > 2.3 +nix develop +# if nix version <= 2.3 +nix-shell +``` + ## Windows In PowerShell (Run as Administrator), set `ExecutionPolicy` to `RemoteSigned`: diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..ceb62c6d --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1666629043, + "narHash": "sha256-Yoq6Ut2F3Ol73yO9hG93x6ts5c4F5BhKTbcF3DtBEAw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b39fd6e4edef83cb4a135ebef98751ce23becc33", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..15c82b77 --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Small exercises to get you used to reading and writing Rust code"; + + inputs = { + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, flake-utils, nixpkgs, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + rustlings = + pkgs.rustPlatform.buildRustPackage { + name = "rustlings"; + version = "5.2.1"; + + src = with pkgs.lib; cleanSourceWith { + src = self; + # a function that returns a bool determining if the path should be included in the cleaned source + filter = path: type: + let + # filename + baseName = builtins.baseNameOf (toString path); + # path from root directory + path' = builtins.replaceStrings [ "${self}/" ] [ "" ] path; + # checks if path is in the directory + inDirectory = directory: hasPrefix directory path'; + in + inDirectory "src" || + inDirectory "tests" || + hasPrefix "Cargo" baseName || + baseName == "info.toml"; + }; + + cargoLock.lockFile = ./Cargo.lock; + }; + in + { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + cargo + rustc + rust-analyzer + rustlings + ]; + }; + }); +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..fa2a56c7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,6 @@ +(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock); +in fetchTarball { + url = + "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; +}) { src = ./.; }).shellNix From a2134d70c6968ec4bc37e4e42a8f09a6e27b7962 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 26 Oct 2022 08:49:52 +0000 Subject: [PATCH 50/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index b994508c..84f29b43 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -236,6 +236,7 @@ authors. azzamsa
azzamsa

πŸ’» mvanschellebeeck
mvanschellebeeck

πŸ–‹ Arkid
Arkid

πŸ–‹ + Tom Kunc
Tom Kunc

πŸ–‹ From a0b10af1a355da8684e942ccc1d7e0d4cef1089d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 26 Oct 2022 08:49:53 +0000 Subject: [PATCH 51/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6e9ece99..523202d3 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1659,6 +1659,15 @@ "contributions": [ "content" ] + }, + { + "login": "tfpk", + "name": "Tom Kunc", + "avatar_url": "https://avatars.githubusercontent.com/u/10906982?v=4", + "profile": "http://tfpk.dev", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From d01ce8304e018b815cbd4488034f2339c749b6b1 Mon Sep 17 00:00:00 2001 From: mfurak Date: Sun, 6 Nov 2022 20:28:34 +0100 Subject: [PATCH 52/75] style: format errors5 with rustfmt --- exercises/error_handling/errors5.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/error_handling/errors5.rs b/exercises/error_handling/errors5.rs index 2ba8f903..6da06ef3 100644 --- a/exercises/error_handling/errors5.rs +++ b/exercises/error_handling/errors5.rs @@ -7,7 +7,7 @@ // For now, think of the `Box` type as an "I want anything that does ???" type, which, given // Rust's usual standards for runtime safety, should strike you as somewhat lenient! -// In short, this particular use case for boxes is for when you want to own a value and you care only that it is a +// In short, this particular use case for boxes is for when you want to own a value and you care only that it is a // type which implements a particular trait. To do so, The Box is declared as of type Box where Trait is the trait // the compiler looks for on any value used in that context. For this exercise, that context is the potential errors // which can be returned in a Result. @@ -46,7 +46,7 @@ impl PositiveNonzeroInteger { match value { x if x < 0 => Err(CreationError::Negative), x if x == 0 => Err(CreationError::Zero), - x => Ok(PositiveNonzeroInteger(x as u64)) + x => Ok(PositiveNonzeroInteger(x as u64)), } } } From 152193b459085c2bdfe41f65df7ea04a032d2a4c Mon Sep 17 00:00:00 2001 From: mfurak Date: Sun, 6 Nov 2022 20:42:17 +0100 Subject: [PATCH 53/75] style: format errors6 with rustfmt --- exercises/error_handling/errors6.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/exercises/error_handling/errors6.rs b/exercises/error_handling/errors6.rs index 1306fb03..8097b490 100644 --- a/exercises/error_handling/errors6.rs +++ b/exercises/error_handling/errors6.rs @@ -16,7 +16,7 @@ use std::num::ParseIntError; #[derive(PartialEq, Debug)] enum ParsePosNonzeroError { Creation(CreationError), - ParseInt(ParseIntError) + ParseInt(ParseIntError), } impl ParsePosNonzeroError { @@ -27,14 +27,11 @@ impl ParsePosNonzeroError { // fn from_parseint... } -fn parse_pos_nonzero(s: &str) - -> Result -{ +fn parse_pos_nonzero(s: &str) -> Result { // TODO: change this to return an appropriate error instead of panicking // when `parse()` returns an error. let x: i64 = s.parse().unwrap(); - PositiveNonzeroInteger::new(x) - .map_err(ParsePosNonzeroError::from_creation) + PositiveNonzeroInteger::new(x).map_err(ParsePosNonzeroError::from_creation) } // Don't change anything below this line. @@ -53,7 +50,7 @@ impl PositiveNonzeroInteger { match value { x if x < 0 => Err(CreationError::Negative), x if x == 0 => Err(CreationError::Zero), - x => Ok(PositiveNonzeroInteger(x as u64)) + x => Ok(PositiveNonzeroInteger(x as u64)), } } } From 6413f5b5d4c56b0a07931f75ecba5ea57694b8d9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 14:14:20 +0000 Subject: [PATCH 54/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 84f29b43..379e9865 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -237,6 +237,7 @@ authors. mvanschellebeeck
mvanschellebeeck

πŸ–‹ Arkid
Arkid

πŸ–‹ Tom Kunc
Tom Kunc

πŸ–‹ + Marek FurΓ‘k
Marek FurΓ‘k

πŸ–‹ From 70f9f08d2cc9a1b0dc40ef1ab3f393417551c5aa Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 14:14:21 +0000 Subject: [PATCH 55/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 523202d3..4caffea7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1668,6 +1668,15 @@ "contributions": [ "content" ] + }, + { + "login": "mfurak", + "name": "Marek FurΓ‘k", + "avatar_url": "https://avatars.githubusercontent.com/u/38523093?v=4", + "profile": "https://github.com/mfurak", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 2e1630c712892f83cb1cc3adfb034f9e358e7a5e Mon Sep 17 00:00:00 2001 From: mokou Date: Fri, 11 Nov 2022 16:12:09 +0100 Subject: [PATCH 56/75] chore: style fixes --- Cargo.toml | 5 ++++- README.md | 2 +- info.toml | 18 +++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dadded68..3f5b253d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "rustlings" version = "5.2.1" -authors = ["Liv ", "Carol (Nichols || Goulding) "] +authors = [ + "Liv ", + "Carol (Nichols || Goulding) ", +] edition = "2021" [dependencies] diff --git a/README.md b/README.md index 9b619d6f..4e0bbf0b 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ After every couple of sections, there will be a quiz that'll test your knowledge ## Enabling `rust-analyzer` -Run the command `rustlings lsp` which will generate a `rust-project.json` at the root of the project, this allows [rust-analyzer](https://rust-analyzer.github.io/) to parse each exercise. +Run the command `rustlings lsp` which will generate a `rust-project.json` at the root of the project, this allows [rust-analyzer](https://rust-analyzer.github.io/) to parse each exercise. ## Continuing On diff --git a/info.toml b/info.toml index a840f9ba..5a177506 100644 --- a/info.toml +++ b/info.toml @@ -416,8 +416,8 @@ path = "exercises/enums/enums3.rs" mode = "test" hint = """ As a first step, you can define enums to compile this code without errors. -and then create a match expression in `process()`. -Note that you need to deconstruct some message variants +and then create a match expression in `process()`. +Note that you need to deconstruct some message variants in the match expression to get value in the variant.""" # STRINGS @@ -476,7 +476,7 @@ name = "modules2" path = "exercises/modules/modules2.rs" mode = "compile" hint = """ -The delicious_snacks module is trying to present an external interface that is +The delicious_snacks module is trying to present an external interface that is different than its internal structure (the `fruits` and `veggies` modules and associated constants). Complete the `use` statements to fit the uses in main and find the one keyword missing for both constants.""" @@ -623,12 +623,12 @@ path = "exercises/error_handling/errors5.rs" mode = "compile" hint = """ There are two different possible `Result` types produced within `main()`, which are -propagated using `?` operators. How do we declare a return type from `main()` that allows both? +propagated using `?` operators. How do we declare a return type from `main()` that allows both? Under the hood, the `?` operator calls `From::from` on the error value to convert it to a boxed trait object, a `Box`. This boxed trait object is polymorphic, and since all errors implement the `error::Error` trait, we can capture lots of different errors in one "Box" -object. +object. Check out this section of the book: https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator @@ -862,7 +862,7 @@ case is a vector of integers and the failure case is a DivisionError. The list_of_results function needs to return a vector of results. -See https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.collect for how +See https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.collect for how the `FromIterator` trait is used in `collect()`. This trait is REALLY powerful! It can make the solution to this exercise infinitely easier.""" @@ -964,10 +964,10 @@ name = "threads1" path = "exercises/threads/threads1.rs" mode = "compile" hint = """ -`JoinHandle` is a struct that is returned from a spawned thread: +`JoinHandle` is a struct that is returned from a spawned thread: https://doc.rust-lang.org/std/thread/fn.spawn.html -A challenge with multi-threaded applications is that the main thread can +A challenge with multi-threaded applications is that the main thread can finish before the spawned threads are completed. https://doc.rust-lang.org/book/ch16-01-threads.html#waiting-for-all-threads-to-finish-using-join-handles @@ -1077,7 +1077,7 @@ 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 +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 appropriate replacement constant from std::f32::consts...""" From ef3ef82057d2e8d499d7bcaa204aeb0edea8a3c7 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 15:44:31 +0000 Subject: [PATCH 57/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 379e9865..515f28da 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -238,6 +238,7 @@ authors. Arkid
Arkid

πŸ–‹ Tom Kunc
Tom Kunc

πŸ–‹ Marek FurΓ‘k
Marek FurΓ‘k

πŸ–‹ + Winter
Winter

πŸ’» From 78e2685d5fd7902c0be9b441846841a9f9cd57c4 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 15:44:32 +0000 Subject: [PATCH 58/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 4caffea7..7d5b26da 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1677,6 +1677,15 @@ "contributions": [ "content" ] + }, + { + "login": "winterqt", + "name": "Winter", + "avatar_url": "https://avatars.githubusercontent.com/u/78392041?v=4", + "profile": "https://winter.cafe", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 43c049df753b3a26b4d018a553ef53ffb63efa33 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 15:45:16 +0000 Subject: [PATCH 59/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 515f28da..b0a5b64c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -240,6 +240,9 @@ authors. Marek FurΓ‘k
Marek FurΓ‘k

πŸ–‹ Winter
Winter

πŸ’» + + Moritz BΓΆhme
Moritz BΓΆhme

πŸ’» + From 28d78e288b3f267865c1c18a465cb3c6b0ff1645 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 15:45:16 +0000 Subject: [PATCH 60/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7d5b26da..bb021499 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1686,6 +1686,15 @@ "contributions": [ "code" ] + }, + { + "login": "MoritzBoehme", + "name": "Moritz BΓΆhme", + "avatar_url": "https://avatars.githubusercontent.com/u/42215704?v=4", + "profile": "https://moritzboeh.me", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 2ceb59a11d7e2c8aa31d3bd7e1c7cb2c94d61300 Mon Sep 17 00:00:00 2001 From: craymel <71062756+craymel@users.noreply.github.com> Date: Fri, 18 Nov 2022 23:38:27 +1100 Subject: [PATCH 61/75] fix: Update structs3 hint --- info.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/info.toml b/info.toml index 5a177506..df3820d2 100644 --- a/info.toml +++ b/info.toml @@ -386,11 +386,9 @@ name = "structs3" path = "exercises/structs/structs3.rs" mode = "test" hint = """ -The new method needs to panic if the weight is physically impossible :), how do we do that in Rust? - For is_international: What makes a package international? Seems related to the places it goes through right? -For calculate_transport_fees: Bigger is more expensive usually, we don't have size, but something may fit the bill here :) +For get_fees: This method takes an additional argument, is there a field in the Package struct that this relates to? Have a look in The Book, to find out more about method implementations: https://doc.rust-lang.org/book/ch05-03-method-syntax.html""" From e8ef4fe5d612e554c2efa55835d351bc7f24f76e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 23:35:51 +0000 Subject: [PATCH 62/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index b0a5b64c..44d8a0ff 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -242,6 +242,7 @@ authors. Moritz BΓΆhme
Moritz BΓΆhme

πŸ’» + craymel
craymel

πŸ–‹ From a8033e0193b39effead5e280fb5ee71a91fde8a1 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 23:35:52 +0000 Subject: [PATCH 63/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index bb021499..9e2f307f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1695,6 +1695,15 @@ "contributions": [ "code" ] + }, + { + "login": "craymel", + "name": "craymel", + "avatar_url": "https://avatars.githubusercontent.com/u/71062756?v=4", + "profile": "https://github.com/craymel", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From be0b7e084ed5713d74c7f1bacdfd563fb2145a95 Mon Sep 17 00:00:00 2001 From: TK Buristrakul Date: Thu, 24 Nov 2022 19:20:59 +0000 Subject: [PATCH 64/75] chore: minor change in comment --- exercises/quiz2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/quiz2.rs b/exercises/quiz2.rs index 606d3c70..715788b8 100644 --- a/exercises/quiz2.rs +++ b/exercises/quiz2.rs @@ -42,7 +42,7 @@ mod my_module { #[cfg(test)] mod tests { - // TODO: What do we have to import to have `transformer` in scope? + // TODO: What do we need to import to have `transformer` in scope? use ???; use super::Command; From a315f2fefb963c2facfd80efe336b8be3b8f6bfa Mon Sep 17 00:00:00 2001 From: TK Buristrakul Date: Thu, 24 Nov 2022 19:39:54 +0000 Subject: [PATCH 65/75] chore: added more descriptive TODOs --- exercises/conversions/as_ref_mut.rs | 13 +++++++------ exercises/options/options1.rs | 2 +- exercises/traits/traits1.rs | 2 +- exercises/traits/traits2.rs | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/exercises/conversions/as_ref_mut.rs b/exercises/conversions/as_ref_mut.rs index c9eed7d0..e6a9d114 100644 --- a/exercises/conversions/as_ref_mut.rs +++ b/exercises/conversions/as_ref_mut.rs @@ -5,21 +5,22 @@ // I AM NOT DONE -// Obtain the number of bytes (not characters) in the given argument -// Add the AsRef trait appropriately as a trait bound +// Obtain the number of bytes (not characters) in the given argument. +// TODO: Add the AsRef trait appropriately as a trait bound. fn byte_counter(arg: T) -> usize { arg.as_ref().as_bytes().len() } -// Obtain the number of characters (not bytes) in the given argument -// Add the AsRef trait appropriately as a trait bound +// Obtain the number of characters (not bytes) in the given argument. +// TODO: Add the AsRef trait appropriately as a trait bound. fn char_counter(arg: T) -> usize { arg.as_ref().chars().count() } -// Squares a number using as_mut(). Add the trait bound as is appropriate and -// implement the function body. +// Squares a number using as_mut(). +// TODO: Add the appropriate trait bound. fn num_sq(arg: &mut T) { + // TODO: Implement the function body. ??? } diff --git a/exercises/options/options1.rs b/exercises/options/options1.rs index 1149af08..1f891b0e 100644 --- a/exercises/options/options1.rs +++ b/exercises/options/options1.rs @@ -6,10 +6,10 @@ // This function returns how much icecream there is left in the fridge. // If it's before 10PM, there's 5 pieces left. At 10PM, someone eats them // all, so there'll be no more left :( -// TODO: Return an Option! fn maybe_icecream(time_of_day: u16) -> Option { // We use the 24-hour system here, so 10PM is a value of 22 and 12AM is a value of 0 // The Option output should gracefully handle cases where time_of_day > 23. + // TODO: Complete the function body - remember to return an Option! ??? } diff --git a/exercises/traits/traits1.rs b/exercises/traits/traits1.rs index 5b9d8d50..43500b86 100644 --- a/exercises/traits/traits1.rs +++ b/exercises/traits/traits1.rs @@ -16,7 +16,7 @@ trait AppendBar { } impl AppendBar for String { - //Add your code here + // TODO: Implement `AppendBar` for type `String`. } fn main() { diff --git a/exercises/traits/traits2.rs b/exercises/traits/traits2.rs index 708bb19a..99dc1cbc 100644 --- a/exercises/traits/traits2.rs +++ b/exercises/traits/traits2.rs @@ -17,7 +17,7 @@ trait AppendBar { fn append_bar(self) -> Self; } -//TODO: Add your code here +// TODO: Implement trait `AppendBar` for a vector of strings. #[cfg(test)] mod tests { From db53dbc12615888ddd021025379fbab8e00e5067 Mon Sep 17 00:00:00 2001 From: TK Buristrakul Date: Thu, 24 Nov 2022 19:41:25 +0000 Subject: [PATCH 66/75] chore: tidied up unmatched backticks --- exercises/traits/traits1.rs | 2 +- exercises/traits/traits2.rs | 2 +- info.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/traits/traits1.rs b/exercises/traits/traits1.rs index 43500b86..f5320a5a 100644 --- a/exercises/traits/traits1.rs +++ b/exercises/traits/traits1.rs @@ -2,7 +2,7 @@ // Time to implement some traits! // // Your task is to implement the trait -// `AppendBar' for the type `String'. +// `AppendBar` for the type `String`. // // The trait AppendBar has only one function, // which appends "Bar" to any object diff --git a/exercises/traits/traits2.rs b/exercises/traits/traits2.rs index 99dc1cbc..288b4983 100644 --- a/exercises/traits/traits2.rs +++ b/exercises/traits/traits2.rs @@ -1,7 +1,7 @@ // traits2.rs // // Your task is to implement the trait -// `AppendBar' for a vector of strings. +// `AppendBar` for a vector of strings. // // To implement this trait, consider for // a moment what it means to 'append "Bar"' diff --git a/info.toml b/info.toml index df3820d2..4b878193 100644 --- a/info.toml +++ b/info.toml @@ -695,7 +695,7 @@ name = "traits2" path = "exercises/traits/traits2.rs" mode = "test" hint = """ -Notice how the trait takes ownership of 'self',and returns `Self'. +Notice how the trait takes ownership of 'self',and returns `Self`. Try mutating the incoming string vector. Have a look at the tests to see what the result should look like! From 71873e676f665b57c6d6362739d8283ec5441f49 Mon Sep 17 00:00:00 2001 From: Tyson Liddell Date: Fri, 9 Dec 2022 20:42:39 +0000 Subject: [PATCH 67/75] fix: Remove superfluous &self indirection --- exercises/enums/enums2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/enums/enums2.rs b/exercises/enums/enums2.rs index 18479f87..167a6b2e 100644 --- a/exercises/enums/enums2.rs +++ b/exercises/enums/enums2.rs @@ -10,7 +10,7 @@ enum Message { impl Message { fn call(&self) { - println!("{:?}", &self); + println!("{:?}", self); } } From e519b5079e93f4555d712771343fa159232cbf96 Mon Sep 17 00:00:00 2001 From: William Webb Date: Tue, 20 Dec 2022 21:17:32 -0600 Subject: [PATCH 68/75] fix(hashmaps3): fix typo in todo hint --- exercises/hashmaps/hashmaps3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/hashmaps/hashmaps3.rs b/exercises/hashmaps/hashmaps3.rs index 18dd44c9..ad3baa68 100644 --- a/exercises/hashmaps/hashmaps3.rs +++ b/exercises/hashmaps/hashmaps3.rs @@ -37,7 +37,7 @@ fn build_scores_table(results: String) -> HashMap { let team_2_score: u8 = v[3].parse().unwrap(); // TODO: Populate the scores table with details extracted from the // current line. Keep in mind that goals scored by team_1 - // will be number of goals conceded from team_2, and similarly + // will be the number of goals conceded from team_2, and similarly // goals scored by team_2 will be the number of goals conceded by // team_1. } From e0eef0e1901b80b5401a8c61346ab32eb54561cd Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 23 Dec 2022 16:16:24 +0100 Subject: [PATCH 69/75] docs: add note about powershell compat Closes #1299. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38972a4b..44ca4bdd 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Then, you can run: 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. +To install Rustlings. Same as on MacOS/Linux, you will have access to the `rustlings` command after it. Keep in mind that this works best in PowerShell, and any other terminals may give you errors. If you get a permission denied message, you might have to exclude the directory where you cloned Rustlings in your antivirus. From 130e57ec60519c269d6477eef0ad681f1ac96d5c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 23 Dec 2022 15:44:14 +0000 Subject: [PATCH 70/75] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 44d8a0ff..2fc637f2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -243,6 +243,7 @@ authors. Moritz BΓΆhme
Moritz BΓΆhme

πŸ’» craymel
craymel

πŸ–‹ + TK Buristrakul
TK Buristrakul

πŸ–‹ From 5e583770f7922b45889cd5e252be0fb87578c088 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 23 Dec 2022 15:44:15 +0000 Subject: [PATCH 71/75] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 9e2f307f..94141140 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1704,6 +1704,15 @@ "contributions": [ "content" ] + }, + { + "login": "tkburis", + "name": "TK Buristrakul", + "avatar_url": "https://avatars.githubusercontent.com/u/20501289?v=4", + "profile": "https://github.com/tkburis", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 40b1b079150e8554b595374d3b72a84108109cc5 Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 23 Dec 2022 16:47:48 +0100 Subject: [PATCH 72/75] fix(enums3): add extra tuple comment --- exercises/enums/enums3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/enums/enums3.rs b/exercises/enums/enums3.rs index 55acf6bc..54fd6f60 100644 --- a/exercises/enums/enums3.rs +++ b/exercises/enums/enums3.rs @@ -52,7 +52,7 @@ mod tests { position: Point { x: 0, y: 0 }, color: (0, 0, 0), }; - state.process(Message::ChangeColor((255, 0, 255))); + state.process(Message::ChangeColor((255, 0, 255))); // Remember: The extra parentheses mark a tuple type. state.process(Message::Echo(String::from("hello world"))); state.process(Message::Move(Point { x: 10, y: 15 })); state.process(Message::Quit); From 9ad884aadb0758baf2c14b949c79d51adcf9b8fb Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 23 Dec 2022 16:53:03 +0100 Subject: [PATCH 73/75] chore: bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 8 ++++---- flake.nix | 2 +- src/main.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 948d0f42..49f20b66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -459,7 +459,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rustlings" -version = "5.2.1" +version = "5.3.0" dependencies = [ "argh", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 3f5b253d..c2c54fd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustlings" -version = "5.2.1" +version = "5.3.0" authors = [ "Liv ", "Carol (Nichols || Goulding) ", diff --git a/README.md b/README.md index 44ca4bdd..956bb6d0 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ This will install Rustlings and give you access to the `rustlings` command. Run Basically: Clone the repository at the latest tag, finally run `nix develop` or `nix-shell`. ```bash -# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.2.1) -git clone -b 5.2.1 --depth 1 https://github.com/rust-lang/rustlings +# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.3.0) +git clone -b 5.3.0 --depth 1 https://github.com/rust-lang/rustlings cd rustlings # if nix version > 2.3 nix develop @@ -70,8 +70,8 @@ If you get a permission denied message, you might have to exclude the directory Basically: Clone the repository at the latest tag, run `cargo install --path .`. ```bash -# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.2.1) -git clone -b 5.2.1 --depth 1 https://github.com/rust-lang/rustlings +# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 5.3.0) +git clone -b 5.3.0 --depth 1 https://github.com/rust-lang/rustlings cd rustlings cargo install --force --path . ``` diff --git a/flake.nix b/flake.nix index 15c82b77..a6703199 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ rustlings = pkgs.rustPlatform.buildRustPackage { name = "rustlings"; - version = "5.2.1"; + version = "5.3.0"; src = with pkgs.lib; cleanSourceWith { src = self; diff --git a/src/main.rs b/src/main.rs index bf8503d0..6dc18e8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ mod run; mod verify; // In sync with crate version -const VERSION: &str = "5.2.1"; +const VERSION: &str = "5.3.0"; #[derive(FromArgs, PartialEq, Debug)] /// Rustlings is a collection of small exercises to get you used to writing and reading Rust code From 32b234c9f0de2f63f905d461639d9f7ed94776bc Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 23 Dec 2022 17:09:04 +0100 Subject: [PATCH 74/75] chore: update changelog --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9925e3db..c351fce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ + +## 5.3.0 (2022-12-23) + +#### Added + +- **cli**: Added a percentage display in watch mode +- Added a `flake.nix` for Nix users + +#### Changed + +- **structs3**: Added an additional test +- **macros**: Added a link to MacroKata in the README + +#### Fixed + +- **strings3**: Added a link to `std` in the hint +- **threads1**: Corrected a hint link +- **iterators1**: Clarified hint steps +- **errors5**: Fix a typo in the hint +- **options1**: Clarified on the usage of the 24-hour system +- **threads2, threads3**: Explicitly use `Arc::clone` +- **structs3**: Clarifed the hint +- **quiz2, as_ref_mut, options1, traits1, traits2**: Clarified hints +- **traits1, traits2, cli**: Tidied up unmatching backticks +- **enums2**: Removed unneccessary indirection of self +- **enums3**: Added an extra tuple comment + +#### Housekeeping + +- Added a VSCode extension recommendation +- Applied some Clippy and rustfmt formatting +- Added a note on Windows PowerShell and other shell compatibility + ## 5.2.1 (2022-09-06) From 430371795133488f9daa1b7d390997fb3d3a7e7b Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Sun, 25 Dec 2022 17:57:28 +0100 Subject: [PATCH 75/75] chore: "rust" -> "Rust" in exercise hints --- info.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info.toml b/info.toml index 4b878193..8356f6ab 100644 --- a/info.toml +++ b/info.toml @@ -665,7 +665,7 @@ name = "generics1" path = "exercises/generics/generics1.rs" mode = "compile" hint = """ -Vectors in rust make use of generics to create dynamically sized arrays of any type. +Vectors in Rust make use of generics to create dynamically sized arrays of any type. You need to tell the compiler what type we are pushing onto this vector.""" [[exercises]] @@ -1071,7 +1071,7 @@ path = "exercises/clippy/clippy1.rs" mode = "clippy" hint = """ Rust stores the highest precision version of any long or inifinite precision -mathematical constants in the rust standard library. +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,