From 4d6cd0ebb4791be37bc50ac6eddb57981eab0b23 Mon Sep 17 00:00:00 2001 From: Adwait Kumar Singh Date: Sat, 11 Nov 2023 16:39:44 -0800 Subject: [PATCH 01/68] Revert "Add CodeCrafters" This reverts commit dad22169849a4d16d6a74c69a45017dab07677ff. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index fdaee283..42e282e0 100644 --- a/README.md +++ b/README.md @@ -154,8 +154,6 @@ Run the command `rustlings lsp` which will generate a `rust-project.json` at the Once you've completed Rustlings, put your new knowledge to good use! Continue practicing your Rust skills by building your own projects, contributing to Rustlings, or finding other open-source projects to contribute to. -On [CodeCrafters](https://codecrafters.io/rust) you can get some quality practice through recreating different technologies from scratch in Rust (e.g Build your own BitTorrent, HTTP Server, SQLite, etc). - ## Uninstalling Rustlings 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 From 3461c4f73dcedab0b7687e04a806a930ce5f3c17 Mon Sep 17 00:00:00 2001 From: Bastian Pedersen Date: Sun, 12 Nov 2023 11:39:14 +0100 Subject: [PATCH 02/68] Reword clippy1 exercise to be more readable --- exercises/22_clippy/clippy1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/22_clippy/clippy1.rs b/exercises/22_clippy/clippy1.rs index 95c0141f..e0c6ce7c4 100644 --- a/exercises/22_clippy/clippy1.rs +++ b/exercises/22_clippy/clippy1.rs @@ -3,8 +3,8 @@ // The Clippy tool is a collection of lints to analyze your code so you can // catch common mistakes and improve your Rust code. // -// For these exercises the code will fail to compile when there are clippy -// warnings check clippy's suggestions from the output to solve the exercise. +// For these exercises the code will fail to compile when there are Clippy +// warnings. Check Clippy's suggestions from the output to solve the exercise. // // Execute `rustlings hint clippy1` or use the `hint` watch subcommand for a // hint. From f01f2d13c75c72282e323c3057cb54fbc29c4600 Mon Sep 17 00:00:00 2001 From: Dilshad <98999149+a-rustacean@users.noreply.github.com> Date: Sun, 12 Nov 2023 22:19:40 +0530 Subject: [PATCH 03/68] Revert "docs: add sarupbanskota as a contributor for doc" --- .all-contributorsrc | 9 --------- AUTHORS.md | 1 - 2 files changed, 10 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 3033ee96..8256c302 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2523,15 +2523,6 @@ "contributions": [ "content" ] - }, - { - "login": "sarupbanskota", - "name": "Sarup Banskota", - "avatar_url": "https://avatars.githubusercontent.com/u/3149580?v=4", - "profile": "https://codecrafters.io", - "contributions": [ - "doc" - ] } ], "contributorsPerLine": 8, diff --git a/AUTHORS.md b/AUTHORS.md index cd64e360..05c48b6e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -356,7 +356,6 @@ authors. Tristram Oaten
Tristram Oaten

πŸ–‹ Daniel Tinazzi
Daniel Tinazzi

πŸ–‹ Raymon Roos
Raymon Roos

πŸ–‹ - Sarup Banskota
Sarup Banskota

πŸ“– From 70f472484f0e43566d146e3184c39dc650f27a74 Mon Sep 17 00:00:00 2001 From: liv Date: Tue, 14 Nov 2023 15:49:52 +0100 Subject: [PATCH 04/68] docs: revert fancy install aliases --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fdaee283..20a65cfc 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,13 @@ You will need to have Rust installed. You can get it by visiting Date: Wed, 15 Nov 2023 23:17:40 +0100 Subject: [PATCH 05/68] chore(watch): update notify dependency to v6 closes #1640 --- Cargo.lock | 261 +++++++++++++++++----------------------------------- Cargo.toml | 2 +- src/main.rs | 68 ++++++++------ 3 files changed, 124 insertions(+), 207 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 418032a7..93489eb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,6 +86,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "bstr" version = "1.6.2" @@ -97,12 +103,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,6 +168,25 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "difflib" version = "0.4.0" @@ -200,14 +219,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -219,41 +238,15 @@ dependencies = [ "num-traits", ] -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags", - "fsevent-sys", -] - [[package]] name = "fsevent-sys" -version = "2.0.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" dependencies = [ "libc", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "glob" version = "0.3.1" @@ -278,7 +271,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -306,11 +299,11 @@ dependencies = [ [[package]] name = "inotify" -version = "0.7.1" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ - "bitflags", + "bitflags 1.3.2", "inotify-sys", "libc", ] @@ -330,16 +323,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", + "cfg-if", ] [[package]] @@ -358,13 +342,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "kqueue" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", ] [[package]] @@ -373,17 +367,11 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" -version = "0.2.140" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "log" @@ -391,7 +379,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -402,56 +390,14 @@ checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "mio" -version = "0.6.23" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "wasi", + "windows-sys 0.48.0", ] [[package]] @@ -462,20 +408,32 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "notify" -version = "4.0.17" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags", + "bitflags 2.4.1", + "crossbeam-channel", "filetime", - "fsevent", "fsevent-sys", "inotify", + "kqueue", "libc", + "log", "mio", - "mio-extras", "walkdir", - "winapi 0.3.9", + "windows-sys 0.48.0", +] + +[[package]] +name = "notify-debouncer-mini" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d40b221972a1fc5ef4d858a2f671fb34c75983eb385463dff3780eeff6a9d43" +dependencies = [ + "crossbeam-channel", + "log", + "notify", ] [[package]] @@ -550,11 +508,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -590,7 +548,7 @@ dependencies = [ "glob", "home", "indicatif", - "notify", + "notify-debouncer-mini", "predicates", "regex", "serde", @@ -653,15 +611,6 @@ dependencies = [ "serde", ] -[[package]] -name = "slab" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] - [[package]] name = "strsim" version = "0.10.0" @@ -757,10 +706,10 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.2.8" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "winapi" @@ -772,12 +721,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -790,7 +733,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -814,37 +757,13 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets", ] [[package]] @@ -954,13 +873,3 @@ checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] diff --git a/Cargo.toml b/Cargo.toml index a055d4f3..24bee7cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" [dependencies] indicatif = "0.17.6" console = "0.15" -notify = "4.0" +notify-debouncer-mini = "0.4.1" toml = "0.7.6" regex = "1.5" serde = { version = "1.0", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index bbff712d..f17d9d95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,8 @@ use crate::run::{reset, run}; use crate::verify::verify; use clap::{Parser, Subcommand}; use console::Emoji; -use notify::DebouncedEvent; -use notify::{RecommendedWatcher, RecursiveMode, Watcher}; +use notify_debouncer_mini::notify::{self, RecursiveMode}; +use notify_debouncer_mini::{new_debouncer, DebouncedEventKind}; use std::ffi::OsStr; use std::fs; use std::io::{self, prelude::*}; @@ -331,8 +331,10 @@ fn watch( let (tx, rx) = channel(); let should_quit = Arc::new(AtomicBool::new(false)); - let mut watcher: RecommendedWatcher = Watcher::new(tx, Duration::from_secs(1))?; - watcher.watch(Path::new("./exercises"), RecursiveMode::Recursive)?; + let mut debouncer = new_debouncer(Duration::from_secs(1), tx)?; + debouncer + .watcher() + .watch(Path::new("./exercises"), RecursiveMode::Recursive)?; clear_screen(); @@ -350,38 +352,44 @@ fn watch( loop { match rx.recv_timeout(Duration::from_secs(1)) { Ok(event) => match event { - DebouncedEvent::Create(b) | DebouncedEvent::Chmod(b) | DebouncedEvent::Write(b) => { - if b.extension() == Some(OsStr::new("rs")) && b.exists() { - let filepath = b.as_path().canonicalize().unwrap(); - let pending_exercises = exercises - .iter() - .find(|e| filepath.ends_with(&e.path)) - .into_iter() - .chain( + Ok(events) => { + for event in events { + let event_path = event.path; + if event.kind == DebouncedEventKind::Any + && event_path.extension() == Some(OsStr::new("rs")) + && event_path.exists() + { + let filepath = event_path.as_path().canonicalize().unwrap(); + let pending_exercises = exercises .iter() - .filter(|e| !e.looks_done() && !filepath.ends_with(&e.path)), - ); - let num_done = exercises - .iter() - .filter(|e| e.looks_done() && !filepath.ends_with(&e.path)) - .count(); - clear_screen(); - match verify( - pending_exercises, - (num_done, exercises.len()), - verbose, - success_hints, - ) { - Ok(_) => return Ok(WatchStatus::Finished), - Err(exercise) => { - let mut failed_exercise_hint = failed_exercise_hint.lock().unwrap(); - *failed_exercise_hint = Some(to_owned_hint(exercise)); + .find(|e| filepath.ends_with(&e.path)) + .into_iter() + .chain(exercises.iter().filter(|e| { + !e.looks_done() && !filepath.ends_with(&e.path) + })); + let num_done = exercises + .iter() + .filter(|e| e.looks_done() && !filepath.ends_with(&e.path)) + .count(); + clear_screen(); + match verify( + pending_exercises, + (num_done, exercises.len()), + verbose, + success_hints, + ) { + Ok(_) => return Ok(WatchStatus::Finished), + Err(exercise) => { + let mut failed_exercise_hint = + failed_exercise_hint.lock().unwrap(); + *failed_exercise_hint = Some(to_owned_hint(exercise)); + } } } } } - _ => {} + Err(e) => println!("watch error: {e:?}"), }, Err(RecvTimeoutError::Timeout) => { // the timeout expired, just check the `should_quit` variable below then loop again From 5c4821ac6ffb8f62db05895ebeed21ae397ed649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Wed, 22 Nov 2023 01:45:19 +0100 Subject: [PATCH 06/68] fix(watch): Fix rendering of the finishing ferris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit 571bab2 ("Run clippy --fix"), the "" string was changed to r"", even though it contains an intentional escape sequence, which now looks wrong. My commit undoes this change: Before: +----------------------------------------------------+ | You made it to the Fe-nish line! | +-------------------------- ------------------------+ \\/ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ β–‘β–‘β–’β–’β–’β–’β–‘β–‘β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–‘β–‘β–’β–’β–’β–’ β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“ β–’β–’β–’β–’ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’β–‘β–‘ β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–“β–“β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–’β–’β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ After: +----------------------------------------------------+ | You made it to the Fe-nish line! | +-------------------------- ------------------------+ \/ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ β–‘β–‘β–’β–’β–’β–’β–‘β–‘β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–‘β–‘β–’β–’β–’β–’ β–“β–“β–“β–“β–“β–“β–“β–“ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–ˆβ–ˆ β–“β–“ β–“β–“β–“β–“β–“β–“β–“β–“ β–’β–’β–’β–’ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’ β–ˆβ–ˆβ–ˆβ–ˆ β–’β–’β–‘β–‘ β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–“β–“β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’β–“β–“β–’β–’β–“β–“β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ Running `cargo clippy` (version 0.1.70) after this commit does not reveal any new warnings. Fixes: 571bab2 ("Run clippy --fix") --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index bbff712d..2aa6f6bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -435,10 +435,10 @@ started, here's a couple of notes about how Rustlings operates: Got all that? Great! To get started, run `rustlings watch` in order to get the first exercise. Make sure to have your editor open!"#; -const FENISH_LINE: &str = r"+----------------------------------------------------+ +const FENISH_LINE: &str = "+----------------------------------------------------+ | You made it to the Fe-nish line! | +-------------------------- ------------------------+ - \\/ + \\/ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ From 12d1bf407ad85da0b1f0c062564af68117ae6111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Wed, 22 Nov 2023 01:40:01 +0100 Subject: [PATCH 07/68] feat(watch): Add red color to the finishing ferris This adds some eye-candy for users who finish Rustlings. It is based on ANSI terminal escape sequences and should work in most environments. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2aa6f6bd..97015af5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -438,7 +438,7 @@ exercise. Make sure to have your editor open!"#; const FENISH_LINE: &str = "+----------------------------------------------------+ | You made it to the Fe-nish line! | +-------------------------- ------------------------+ - \\/ + \\/\x1b[31m β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’ @@ -453,7 +453,7 @@ const FENISH_LINE: &str = "+---------------------------------------------------- β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ β–’β–’ - β–’β–’ β–’β–’ β–’β–’ β–’β–’ + β–’β–’ β–’β–’ β–’β–’ β–’β–’\x1b[0m We hope you enjoyed learning about the various aspects of Rust! If you noticed any issues, please don't hesitate to report them to our repo. From 21b1e6ecf875e1fe1453c54cdba8224e98acb740 Mon Sep 17 00:00:00 2001 From: parnavh Date: Wed, 22 Nov 2023 22:06:17 +0530 Subject: [PATCH 08/68] fix(move_semantics): removed unused mut --- exercises/06_move_semantics/move_semantics2.rs | 2 +- exercises/06_move_semantics/move_semantics3.rs | 2 +- exercises/06_move_semantics/move_semantics4.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06_move_semantics/move_semantics2.rs b/exercises/06_move_semantics/move_semantics2.rs index baf6bcc9..dc58be50 100644 --- a/exercises/06_move_semantics/move_semantics2.rs +++ b/exercises/06_move_semantics/move_semantics2.rs @@ -11,7 +11,7 @@ fn main() { let vec0 = vec![22, 44, 66]; - let mut vec1 = fill_vec(vec0); + let vec1 = fill_vec(vec0); assert_eq!(vec0, vec![22, 44, 66]); assert_eq!(vec1, vec![22, 44, 66, 88]); diff --git a/exercises/06_move_semantics/move_semantics3.rs b/exercises/06_move_semantics/move_semantics3.rs index 7af9e694..7152c716 100644 --- a/exercises/06_move_semantics/move_semantics3.rs +++ b/exercises/06_move_semantics/move_semantics3.rs @@ -12,7 +12,7 @@ fn main() { let vec0 = vec![22, 44, 66]; - let mut vec1 = fill_vec(vec0); + let vec1 = fill_vec(vec0); assert_eq!(vec1, vec![22, 44, 66, 88]); } diff --git a/exercises/06_move_semantics/move_semantics4.rs b/exercises/06_move_semantics/move_semantics4.rs index 80b49dba..bfc917fa 100644 --- a/exercises/06_move_semantics/move_semantics4.rs +++ b/exercises/06_move_semantics/move_semantics4.rs @@ -13,7 +13,7 @@ fn main() { let vec0 = vec![22, 44, 66]; - let mut vec1 = fill_vec(vec0); + let vec1 = fill_vec(vec0); assert_eq!(vec1, vec![22, 44, 66, 88]); } From 194e0b951d5e2c3c869592c39a20e5acb311e1fa Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:10:37 +0000 Subject: [PATCH 09/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 05c48b6e..a768b3fa 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -356,6 +356,7 @@ authors. Tristram Oaten
Tristram Oaten

πŸ–‹ Daniel Tinazzi
Daniel Tinazzi

πŸ–‹ Raymon Roos
Raymon Roos

πŸ–‹ + Matthias
Matthias

πŸ’» From 5d78a2f103c8dad2f1d8084c04acb8a9c691ac5a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:10:38 +0000 Subject: [PATCH 10/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8256c302..777e5946 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2523,6 +2523,15 @@ "contributions": [ "content" ] + }, + { + "login": "matthri", + "name": "Matthias", + "avatar_url": "https://avatars.githubusercontent.com/u/67913999?v=4", + "profile": "https://github.com/matthri", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 4b800978179c9a07636a17ce4060ab78ae78958b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:33:58 +0000 Subject: [PATCH 11/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index a768b3fa..b07ffdc9 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -357,6 +357,7 @@ authors. Daniel Tinazzi
Daniel Tinazzi

πŸ–‹ Raymon Roos
Raymon Roos

πŸ–‹ Matthias
Matthias

πŸ’» + J. NeuschΓ€fer
J. NeuschΓ€fer

πŸ’» From 3e7f1e3ff24b8618e7738091a5c78d316f673450 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:33:59 +0000 Subject: [PATCH 12/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 777e5946..681392bd 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2532,6 +2532,15 @@ "contributions": [ "code" ] + }, + { + "login": "neuschaefer", + "name": "J. NeuschΓ€fer", + "avatar_url": "https://avatars.githubusercontent.com/u/1021512?v=4", + "profile": "https://github.com/neuschaefer", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 5bbdb3d5ba758ea3fc143c0930ed84a92a4a814d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:39:43 +0000 Subject: [PATCH 13/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index b07ffdc9..21597acb 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -358,6 +358,7 @@ authors. Raymon Roos
Raymon Roos

πŸ–‹ Matthias
Matthias

πŸ’» J. NeuschΓ€fer
J. NeuschΓ€fer

πŸ’» + Bastian Pedersen
Bastian Pedersen

πŸ–‹ From 8863855627648c140ef1bd64711936e8a6597e1d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:39:44 +0000 Subject: [PATCH 14/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 681392bd..2008f03b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2541,6 +2541,15 @@ "contributions": [ "code" ] + }, + { + "login": "bastianpedersen", + "name": "Bastian Pedersen", + "avatar_url": "https://avatars.githubusercontent.com/u/58905488?v=4", + "profile": "https://scooterhacking.org", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 93aef73eb54759ad7491306e69946de1975012bd Mon Sep 17 00:00:00 2001 From: Sergei Gerasenko Date: Tue, 9 Jan 2024 10:16:51 -0600 Subject: [PATCH 15/68] Correct for more standard English --- exercises/11_hashmaps/hashmaps3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/11_hashmaps/hashmaps3.rs b/exercises/11_hashmaps/hashmaps3.rs index 08e977c3..36544ee3 100644 --- a/exercises/11_hashmaps/hashmaps3.rs +++ b/exercises/11_hashmaps/hashmaps3.rs @@ -36,7 +36,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 the number of goals conceded from team_2, and similarly + // will be the number of goals conceded by team_2, and similarly // goals scored by team_2 will be the number of goals conceded by // team_1. } From 3200581d4dfff638db6328990ad061be52b97643 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:51:47 +0000 Subject: [PATCH 16/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 21597acb..5466c9cf 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -360,6 +360,9 @@ authors. J. NeuschΓ€fer
J. NeuschΓ€fer

πŸ’» Bastian Pedersen
Bastian Pedersen

πŸ–‹ + + gerases
gerases

πŸ–‹ + From e2674498c6504e7d7a7d55f1e19907c77f7b5d91 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:51:48 +0000 Subject: [PATCH 17/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2008f03b..cc268765 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2550,6 +2550,15 @@ "contributions": [ "content" ] + }, + { + "login": "gerases", + "name": "gerases", + "avatar_url": "https://avatars.githubusercontent.com/u/8953623?v=4", + "profile": "https://github.com/gerases", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From b70ed105db29fb908f97b117b56ed3732837df08 Mon Sep 17 00:00:00 2001 From: reifenrath-dev Date: Fri, 19 Jan 2024 11:18:54 +0100 Subject: [PATCH 18/68] chore: update from_into.rs task description to fit the code --- exercises/23_conversions/from_into.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/23_conversions/from_into.rs b/exercises/23_conversions/from_into.rs index 60911f3e..d78b7b5b 100644 --- a/exercises/23_conversions/from_into.rs +++ b/exercises/23_conversions/from_into.rs @@ -24,7 +24,7 @@ impl Default for Person { } } -// Your task is to complete this implementation in order for the line `let p = +// Your task is to complete this implementation in order for the line `let p1 = // Person::from("Mark,20")` to compile Please note that you'll need to parse the // age component into a `usize` with something like `"4".parse::()`. The // outcome of this needs to be handled appropriately. From 6072ec16a01461af9914ad89899de498d0309de7 Mon Sep 17 00:00:00 2001 From: Peter Neave Date: Tue, 23 Jan 2024 12:33:21 +1100 Subject: [PATCH 19/68] fix: Ensure scripts have LF line endings Use gitattributes file to ensure script files have LF line endings. This solves a problem for users who wish to use DevContainers on Windows machines and the file has been cloned from the repository with CRLF line endings. --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..efdba876 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +*.sh text eol=lf From bcb192c707009ab9d9bb06812cb09b9d446ccc11 Mon Sep 17 00:00:00 2001 From: LeverImmy <506503360@qq.com> Date: Sun, 4 Feb 2024 10:51:06 +0800 Subject: [PATCH 20/68] chore: fixed minor typo --- exercises/23_conversions/from_into.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/23_conversions/from_into.rs b/exercises/23_conversions/from_into.rs index 60911f3e..00f8c2ff 100644 --- a/exercises/23_conversions/from_into.rs +++ b/exercises/23_conversions/from_into.rs @@ -25,7 +25,7 @@ impl Default for Person { } // Your task is to complete this implementation in order for the line `let p = -// Person::from("Mark,20")` to compile Please note that you'll need to parse the +// Person::from("Mark,20")` to compile. Please note that you'll need to parse the // age component into a `usize` with something like `"4".parse::()`. The // outcome of this needs to be handled appropriately. // From 53c40024d894beb45f4319d08ff054d7d7ac319f Mon Sep 17 00:00:00 2001 From: luvchurchill <46406654+luvchurchill@users.noreply.github.com> Date: Tue, 6 Feb 2024 01:54:04 +0200 Subject: [PATCH 21/68] Added .git to end of Repo's https URL The install.sh script didn't work for me, after I changed this locally it worked URL needs to end in .git --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5915a33d..fdbe8d43 100755 --- a/install.sh +++ b/install.sh @@ -137,7 +137,7 @@ fi Path=${1:-rustlings/} echo "Cloning Rustlings at $Path..." -git clone -q https://github.com/rust-lang/rustlings "$Path" +git clone -q https://github.com/rust-lang/rustlings.git "$Path" cd "$Path" From 75ee0e42450713cc8c8288c71a0f148cdefea526 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 12 Feb 2024 18:13:20 +0100 Subject: [PATCH 22/68] Clarified hint text --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 887662ab..aa4ed052 100644 --- a/info.toml +++ b/info.toml @@ -145,7 +145,7 @@ after the `->`. This is where the function's return type should be -- take a look at the `is_even` function for an example! Also: Did you figure out that, technically, `u32` would be the more fitting type -for the prices here, since they can't be negative? If so, kudos!""" +for the inputs of the functions here, since the original prices shouldn't be negative? If so, kudos!""" [[exercises]] name = "functions5" From 1da82a0eabdae611519d0c58aff34eb9c792dc90 Mon Sep 17 00:00:00 2001 From: Guizoul Date: Wed, 28 Feb 2024 14:19:05 +0100 Subject: [PATCH 23/68] docs: Added comment for handling equal numbers in if/if1.rs `bigger` function --- exercises/03_if/if1.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/03_if/if1.rs b/exercises/03_if/if1.rs index 4734d78f..38d283c2 100644 --- a/exercises/03_if/if1.rs +++ b/exercises/03_if/if1.rs @@ -6,6 +6,7 @@ pub fn bigger(a: i32, b: i32) -> i32 { // Complete this function to return the bigger number! + // If both numbers are equal, any of them is returned. // Do not use: // - another function call // - additional variables From 19b5e24d5caf551aef5fd749ed7437d3044bf6ce Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Mon, 4 Mar 2024 10:38:09 -0500 Subject: [PATCH 24/68] Update hashmaps3.rs description for clarity I struggled with this exercise and didn't understand that it was looking for a summary of goals scored/conceded per team, instead of per match. My goal here is just to clarify the language, essentially saying "the total number of goals the team scored" to indicate that we are looking for a sum. Updated the exercise description to clarify this point. Relates loosely to closed issue https://github.com/rust-lang/rustlings/issues/1361 --- exercises/11_hashmaps/hashmaps3.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exercises/11_hashmaps/hashmaps3.rs b/exercises/11_hashmaps/hashmaps3.rs index 36544ee3..8d9236df 100644 --- a/exercises/11_hashmaps/hashmaps3.rs +++ b/exercises/11_hashmaps/hashmaps3.rs @@ -4,10 +4,11 @@ // the form : ",,," // Example: England,France,4,2 (England scored 4 goals, France 2). // -// You have to build a scores table containing the name of the team, goals the -// team scored, and goals the team conceded. One approach to build the scores -// table is to use a Hashmap. The solution is partially written to use a -// Hashmap, complete it to pass the test. +// You have to build a scores table containing the name of the team, the total +// number of goals the team scored, and the total number of goals the team +// conceded. One approach to build the scores table is to use a Hashmap. +// The solution is partially written to use a Hashmap, +// complete it to pass the test. // // Make me pass the tests! // From 373676a57601374a7c7d8b2aa447ecf249a1caa1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:02:08 +0000 Subject: [PATCH 25/68] chore(deps): bump mio from 0.8.9 to 0.8.11 Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.9 to 0.8.11. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/compare/v0.8.9...v0.8.11) --- updated-dependencies: - dependency-name: mio dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93489eb0..5858d3ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,9 +390,9 @@ checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", From 547f3ac835bb6cf0db654c528d31bce361d01381 Mon Sep 17 00:00:00 2001 From: luna <26529488+hyphena@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:31:33 -0500 Subject: [PATCH 26/68] chore: minor typo fix --- info.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info.toml b/info.toml index 887662ab..39eb33ed 100644 --- a/info.toml +++ b/info.toml @@ -248,7 +248,7 @@ starting and ending (plus one) indices of the items in the `Array` that you want to end up in the slice. If you're curious why the first argument of `assert_eq!` does not have an -ampersand for a reference since the second argument is areference, take a look +ampersand for a reference since the second argument is a reference, take a look at the coercion chapter of the nomicon: https://doc.rust-lang.org/nomicon/coercions.html""" From 11f0fd7fd9673996d8d2381ade1a371f945f1875 Mon Sep 17 00:00:00 2001 From: Kyle VanderBeek Date: Sat, 9 Mar 2024 19:45:50 +0000 Subject: [PATCH 27/68] Convert to lightweight dev container; simplify. Instead of running `rustup` on a multi-gigabyte general-purpose Linux base, use the premade devcontainers/rust:1 which closely tracks the rust toolchain releases. Rip out excess setup steps since devcontainers come with the repo checked out; just compile/update the binary. --- .devcontainer/devcontainer.json | 8 +------- .devcontainer/setup.sh | 7 ------- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100755 .devcontainer/setup.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e1b2cec1..59f9571a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,6 @@ { - "image": "mcr.microsoft.com/devcontainers/universal:2-linux", - "waitFor": "onCreateCommand", - "onCreateCommand": ".devcontainer/setup.sh", + "image": "mcr.microsoft.com/devcontainers/rust:1", "updateContentCommand": "cargo build", - "postCreateCommand": "", - "postAttachCommand": { - "server": "rustlings watch" - }, "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh deleted file mode 100755 index 0e090a86..00000000 --- a/.devcontainer/setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -curl https://sh.rustup.rs -sSf | sh -s -- -y - -# Update current shell environment variables after install to find rustup -. "$HOME/.cargo/env" -rustup install stable -bash install.sh From e424e9f6c78ec54c5a91b942398f7012f46f6c90 Mon Sep 17 00:00:00 2001 From: Kyle VanderBeek Date: Sat, 9 Mar 2024 20:07:51 +0000 Subject: [PATCH 28/68] Add target directory to $PATH Makes the pre-built command work in the shell right away. --- .devcontainer/devcontainer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 59f9571a..643021aa 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,9 @@ { "image": "mcr.microsoft.com/devcontainers/rust:1", "updateContentCommand": "cargo build", + "remoteEnv": { + "PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/target/debug" + }, "customizations": { "vscode": { "extensions": [ From 77903200a0c19ef4ad2de7b2abec06e301d0dccc Mon Sep 17 00:00:00 2001 From: Kyle VanderBeek Date: Sat, 9 Mar 2024 20:20:14 +0000 Subject: [PATCH 29/68] Remove duplicate vscode extension list. It's already in the vendor-specific .vscode files. --- .devcontainer/devcontainer.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 643021aa..a7f4f78f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,12 +3,5 @@ "updateContentCommand": "cargo build", "remoteEnv": { "PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/target/debug" - }, - "customizations": { - "vscode": { - "extensions": [ - "rust-lang.rust-analyzer" - ] - } } } From 2fb135026cd3b072a54fdd211405090afca6f75e Mon Sep 17 00:00:00 2001 From: Kyle VanderBeek Date: Sat, 9 Mar 2024 23:18:31 +0000 Subject: [PATCH 30/68] Add back the post-attach watch. --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a7f4f78f..f25e8bd8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,7 @@ { "image": "mcr.microsoft.com/devcontainers/rust:1", - "updateContentCommand": "cargo build", + "updateContentCommand": ["cargo", "build"], + "postAttachCommand": ["rustlings", "watch"], "remoteEnv": { "PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/target/debug" } From 36db08340d4503ac363e9f6499fc534a479b7491 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 10 Mar 2024 23:57:35 +0100 Subject: [PATCH 31/68] Update dependencies --- Cargo.lock | 334 ++++++++++++++++++++++++++--------------------------- Cargo.toml | 22 ++-- 2 files changed, 174 insertions(+), 182 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93489eb0..3950c476 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -27,43 +27,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "assert_cmd" -version = "2.0.12" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" +checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8" dependencies = [ "anstyle", "bstr", @@ -88,15 +88,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bstr" -version = "1.6.2" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "regex-automata", @@ -111,9 +111,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.3" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -121,9 +121,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -145,9 +145,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -157,35 +157,31 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "console" -version = "0.15.5" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "difflib" @@ -199,12 +195,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -219,14 +209,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -255,9 +245,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -267,18 +257,18 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "home" -version = "0.5.4" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", @@ -286,9 +276,9 @@ dependencies = [ [[package]] name = "indicatif" -version = "0.17.6" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", "instant", @@ -326,20 +316,11 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "kqueue" @@ -369,30 +350,27 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "log" -version = "0.4.17" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -412,7 +390,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "crossbeam-channel", "filetime", "fsevent-sys", @@ -438,9 +416,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -453,20 +431,19 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "portable-atomic" -version = "1.4.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "predicates" -version = "3.0.3" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", "difflib", "float-cmp", - "itertools", "normalize-line-endings", "predicates-core", "regex", @@ -490,53 +467,59 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.53" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.7.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" - [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustlings" @@ -558,9 +541,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -573,18 +556,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.158" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.158" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -593,9 +576,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -604,24 +587,24 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" -version = "2.0.8" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -636,9 +619,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "toml" -version = "0.7.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", @@ -648,18 +631,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ "indexmap", "serde", @@ -670,15 +653,15 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "utf8parse" @@ -697,9 +680,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -729,9 +712,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -742,28 +725,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", ] [[package]] @@ -782,10 +759,19 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] [[package]] name = "windows_aarch64_gnullvm" @@ -794,10 +780,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -806,10 +792,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -818,10 +804,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -830,10 +816,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -842,10 +828,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -854,10 +840,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -866,10 +852,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "winnow" -version = "0.5.15" +name = "windows_x86_64_msvc" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 24bee7cf..218b7990 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,22 +9,22 @@ authors = [ edition = "2021" [dependencies] -indicatif = "0.17.6" -console = "0.15" -notify-debouncer-mini = "0.4.1" -toml = "0.7.6" -regex = "1.5" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0.81" -home = "0.5.3" +clap = { version = "4.5.2", features = ["derive"] } +console = "0.15.8" glob = "0.3.0" -clap = { version = "4.4.0", features = ["derive"] } +home = "0.5.9" +indicatif = "0.17.8" +notify-debouncer-mini = "0.4.1" +regex = "1.10.3" +serde_json = "1.0.114" +serde = { version = "1.0.197", features = ["derive"] } +toml = "0.8.10" [[bin]] name = "rustlings" path = "src/main.rs" [dev-dependencies] -assert_cmd = "2.0.12" -predicates = "3.0.3" +assert_cmd = "2.0.14" glob = "0.3.0" +predicates = "3.1.0" From f5e9db90ccb5b84fbcb0ccff8aaade50588d534c Mon Sep 17 00:00:00 2001 From: pavedroad Date: Tue, 12 Mar 2024 14:35:48 +0800 Subject: [PATCH 32/68] chore: fix typo Signed-off-by: pavedroad --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7226a47..a199e4de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -167,7 +167,7 @@ - **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 +- **enums2**: Removed unnecessary indirection of self - **enums3**: Added an extra tuple comment #### Housekeeping From 098ff228d73d9f359e948712acb346240e85af05 Mon Sep 17 00:00:00 2001 From: Ahmed <111569638+0Ahmed-0@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:35:53 +0200 Subject: [PATCH 33/68] chore: fix a minor typo --- exercises/09_strings/strings3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/09_strings/strings3.rs b/exercises/09_strings/strings3.rs index b29f9325..384e7ce3 100644 --- a/exercises/09_strings/strings3.rs +++ b/exercises/09_strings/strings3.rs @@ -11,7 +11,7 @@ fn trim_me(input: &str) -> String { } fn compose_me(input: &str) -> String { - // TODO: Add " world!" to the string! There's multiple ways to do this! + // TODO: Add " world!" to the string! There are multiple ways to do this! ??? } From c46a7115265406330dc95fc7ab8e500cd8d24859 Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 15 Mar 2024 13:48:57 +0100 Subject: [PATCH 34/68] fix: revert from_into test change --- exercises/23_conversions/from_into.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exercises/23_conversions/from_into.rs b/exercises/23_conversions/from_into.rs index 60911f3e..da1a9a5f 100644 --- a/exercises/23_conversions/from_into.rs +++ b/exercises/23_conversions/from_into.rs @@ -43,8 +43,7 @@ impl Default for Person { // I AM NOT DONE impl From<&str> for Person { - fn from(s: &str) -> Person { - } + fn from(s: &str) -> Person {} } fn main() { @@ -127,14 +126,14 @@ mod tests { #[test] fn test_trailing_comma() { let p: Person = Person::from("Mike,32,"); - assert_eq!(p.name, "Mike"); - assert_eq!(p.age, 32); + assert_eq!(p.name, "John"); + assert_eq!(p.age, 30); } #[test] fn test_trailing_comma_and_some_string() { - let p: Person = Person::from("Mike,32,man"); - assert_eq!(p.name, "Mike"); - assert_eq!(p.age, 32); + let p: Person = Person::from("Mike,32,dog"); + assert_eq!(p.name, "John"); + assert_eq!(p.age, 30); } } From 17ee0e3c7a47054baf5e66c5525541e4153c03b7 Mon Sep 17 00:00:00 2001 From: Luca Plian <98339220+AnonimAnonim2245@users.noreply.github.com> Date: Fri, 15 Mar 2024 14:51:24 +0200 Subject: [PATCH 35/68] optimized the UI code (#1830) --- src/ui.rs | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/ui.rs b/src/ui.rs index 1ee46316..74835e13 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,33 +1,28 @@ -macro_rules! warn { - ($fmt:literal, $ex:expr) => {{ +macro_rules! print_emoji { + ($emoji:expr, $sign:expr, $color: ident ,$fmt:literal, $ex:expr) => {{ use console::{style, Emoji}; use std::env; let formatstr = format!($fmt, $ex); if env::var("NO_EMOJI").is_ok() { - println!("{} {}", style("!").red(), style(formatstr).red()); + println!("{} {}", style($sign).$color(), style(formatstr).$color()); } else { println!( "{} {}", - style(Emoji("⚠️ ", "!")).red(), - style(formatstr).red() + style(Emoji($emoji, $sign)).$color(), + style(formatstr).$color() ); } }}; } -macro_rules! success { +macro_rules! warn { ($fmt:literal, $ex:expr) => {{ - use console::{style, Emoji}; - use std::env; - let formatstr = format!($fmt, $ex); - if env::var("NO_EMOJI").is_ok() { - println!("{} {}", style("βœ“").green(), style(formatstr).green()); - } else { - println!( - "{} {}", - style(Emoji("βœ…", "βœ“")).green(), - style(formatstr).green() - ); - } + print_emoji!("⚠️ ", "!", red, $fmt, $ex); + }}; +} + +macro_rules! success { + ($fmt:literal, $ex:expr) => {{ + print_emoji!("βœ… ", "βœ“", green, $fmt, $ex); }}; } From 2b97faa1d391ab473b542dd02e70cca27356a04a Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:51:43 +0000 Subject: [PATCH 36/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 5466c9cf..ca834ad6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -362,6 +362,7 @@ authors. gerases
gerases

πŸ–‹ + Luca Plian
Luca Plian

πŸ’» From 3c6c29e19e2f46434fb8c9c0df3d1950053213c1 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:51:44 +0000 Subject: [PATCH 37/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index cc268765..c16d2c5e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2559,6 +2559,15 @@ "contributions": [ "content" ] + }, + { + "login": "AnonimAnonim2245", + "name": "Luca Plian", + "avatar_url": "https://avatars.githubusercontent.com/u/98339220?v=4", + "profile": "https://github.com/AnonimAnonim2245", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 557bbe2b85235da28774fb136ed505f1fd4ddf6d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:52:53 +0000 Subject: [PATCH 38/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index ca834ad6..4685d256 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -363,6 +363,7 @@ authors. gerases
gerases

πŸ–‹ Luca Plian
Luca Plian

πŸ’» + RenΓ© Reifenrath
RenΓ© Reifenrath

πŸ–‹ From 6f88dd437e44e775d0fbb1b976eb032548d1ecfc Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:52:54 +0000 Subject: [PATCH 39/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index c16d2c5e..8a248ecb 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2568,6 +2568,15 @@ "contributions": [ "code" ] + }, + { + "login": "reifenrath-dev", + "name": "RenΓ© Reifenrath", + "avatar_url": "https://avatars.githubusercontent.com/u/18126097?v=4", + "profile": "https://reifenrath.dev/", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From fe698d90967a57729560322e39bf3e95c2e97ac5 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:56:52 +0000 Subject: [PATCH 40/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 4685d256..ba08a15b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -364,6 +364,7 @@ authors. gerases
gerases

πŸ–‹ Luca Plian
Luca Plian

πŸ’» RenΓ© Reifenrath
RenΓ© Reifenrath

πŸ–‹ + Peter Neave
Peter Neave

πŸš‡ From 0d5c105c15fe85900ee39f4aa8cfe1ffc3d5d63c Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:56:53 +0000 Subject: [PATCH 41/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 8a248ecb..9c35721d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2577,6 +2577,15 @@ "contributions": [ "content" ] + }, + { + "login": "peterneave", + "name": "Peter Neave", + "avatar_url": "https://avatars.githubusercontent.com/u/7982708?v=4", + "profile": "https://github.com/peterneave", + "contributions": [ + "infra" + ] } ], "contributorsPerLine": 8, From 032e3c9f3017f392e627dd99daae83b5f0fa09ff Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:02:09 +0000 Subject: [PATCH 42/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index ba08a15b..ae29b64d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -365,6 +365,7 @@ authors. Luca Plian
Luca Plian

πŸ’» RenΓ© Reifenrath
RenΓ© Reifenrath

πŸ–‹ Peter Neave
Peter Neave

πŸš‡ + Jan
Jan

πŸ–‹ From 4c51cb09092717855486286ddc5462fbd0a45b29 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:02:10 +0000 Subject: [PATCH 43/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 9c35721d..29eea970 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2586,6 +2586,15 @@ "contributions": [ "infra" ] + }, + { + "login": "JanB1", + "name": "Jan", + "avatar_url": "https://avatars.githubusercontent.com/u/5552248?v=4", + "profile": "http://www.janb1.com", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From fe28feba1e164267a16210fd5dd80b701fa38c1d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:17:17 +0000 Subject: [PATCH 44/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index ae29b64d..cf66d7f6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -366,6 +366,7 @@ authors. RenΓ© Reifenrath
RenΓ© Reifenrath

πŸ–‹ Peter Neave
Peter Neave

πŸš‡ Jan
Jan

πŸ–‹ + Kyle VanderBeek
Kyle VanderBeek

πŸš‡ From 62b435a309c154a610c428cf57825b287a9c26e9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:17:18 +0000 Subject: [PATCH 45/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 29eea970..80ca245a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2595,6 +2595,15 @@ "contributions": [ "content" ] + }, + { + "login": "kylev", + "name": "Kyle VanderBeek", + "avatar_url": "https://avatars.githubusercontent.com/u/46888?v=4", + "profile": "http://www.kylev.com/", + "contributions": [ + "infra" + ] } ], "contributorsPerLine": 8, From 3f0dc81a9c065dd44f41ce1a462e2998173f3eb0 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:19:33 +0000 Subject: [PATCH 46/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index cf66d7f6..e150ffe0 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -367,6 +367,7 @@ authors. Peter Neave
Peter Neave

πŸš‡ Jan
Jan

πŸ–‹ Kyle VanderBeek
Kyle VanderBeek

πŸš‡ + pavedroad
pavedroad

πŸ–‹ From 1ac392a551201c073bb22a76075e987218b583a6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:19:34 +0000 Subject: [PATCH 47/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 80ca245a..f2d04b2b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2604,6 +2604,15 @@ "contributions": [ "infra" ] + }, + { + "login": "pavedroad", + "name": "pavedroad", + "avatar_url": "https://avatars.githubusercontent.com/u/138004431?v=4", + "profile": "https://github.com/pavedroad", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 3d6b5e81020729e3c684f767d2ca6e7789c66cf3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:22:13 +0000 Subject: [PATCH 48/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index e150ffe0..854b6b6a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -368,6 +368,7 @@ authors. Jan
Jan

πŸ–‹ Kyle VanderBeek
Kyle VanderBeek

πŸš‡ pavedroad
pavedroad

πŸ–‹ + luna
luna

πŸ–‹ From 9cf5a2f83f44a0f43b66810d2dfcc71d4d53e712 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:22:14 +0000 Subject: [PATCH 49/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index f2d04b2b..c5424b3c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2613,6 +2613,15 @@ "contributions": [ "content" ] + }, + { + "login": "hyphena", + "name": "luna", + "avatar_url": "https://avatars.githubusercontent.com/u/26529488?v=4", + "profile": "https://github.com/hyphena", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 4304b3981e353b1fe55eea1f07f3b2ec172fdcb8 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:32:30 +0000 Subject: [PATCH 50/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 854b6b6a..aabfb9dc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -370,6 +370,9 @@ authors. pavedroad
pavedroad

πŸ–‹ luna
luna

πŸ–‹ + + Evan Miller
Evan Miller

πŸ–‹ + From 8d1258f26abed7bc8c222974b5430e51fc8628e5 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:32:31 +0000 Subject: [PATCH 51/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index c5424b3c..431c3cd5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2622,6 +2622,15 @@ "contributions": [ "content" ] + }, + { + "login": "evanmiller2112", + "name": "Evan Miller", + "avatar_url": "https://avatars.githubusercontent.com/u/28488957?v=4", + "profile": "https://github.com/evanmiller2112", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From f8f627b6f76bfae3fb23cb0c06aecfa644a27d87 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:35:16 +0000 Subject: [PATCH 52/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index aabfb9dc..39a3b6bf 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -372,6 +372,7 @@ authors. Evan Miller
Evan Miller

πŸ–‹ + luvchurchill
luvchurchill

πŸ’» From c01ddbc7477dc062dd7fac06ba5cb9e5eeaa15e9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:35:17 +0000 Subject: [PATCH 53/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 431c3cd5..7d26d4cb 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2631,6 +2631,15 @@ "contributions": [ "content" ] + }, + { + "login": "luvchurchill", + "name": "luvchurchill", + "avatar_url": "https://avatars.githubusercontent.com/u/46406654?v=4", + "profile": "https://github.com/luvchurchill", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From b7add6a1a81c77c09971cc2330fb9d016c7c8cac Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:37:01 +0000 Subject: [PATCH 54/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 39a3b6bf..bf97ce7f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -373,6 +373,7 @@ authors. Evan Miller
Evan Miller

πŸ–‹ luvchurchill
luvchurchill

πŸ’» + Ze-en Xiong
Ze-en Xiong

πŸ–‹ From b7b74910d8fe8aed81df5fe120bc2f4c272877de Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:37:02 +0000 Subject: [PATCH 55/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7d26d4cb..b093b480 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2640,6 +2640,15 @@ "contributions": [ "code" ] + }, + { + "login": "LeverImmy", + "name": "Ze-en Xiong", + "avatar_url": "https://avatars.githubusercontent.com/u/47663913?v=4", + "profile": "https://leverimmy.top/", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 1c3b129a532d7d99bf81a232ae76c49892c6ff82 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:39:18 +0000 Subject: [PATCH 56/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index bf97ce7f..a037a647 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -374,6 +374,7 @@ authors. Evan Miller
Evan Miller

πŸ–‹ luvchurchill
luvchurchill

πŸ’» Ze-en Xiong
Ze-en Xiong

πŸ–‹ + Parnav Harinathan
Parnav Harinathan

πŸ–‹ From 1e69e6799778ce54d64227a05dd60e4e89753bbd Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:39:19 +0000 Subject: [PATCH 57/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index b093b480..60f034ef 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2649,6 +2649,15 @@ "contributions": [ "content" ] + }, + { + "login": "parnavh", + "name": "Parnav Harinathan", + "avatar_url": "https://avatars.githubusercontent.com/u/45985534?v=4", + "profile": "https://github.com/parnavh", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 0d37f9011c818112c2c9ff1792c3b8a55a6c3160 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:40:36 +0000 Subject: [PATCH 58/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index a037a647..a74e77f5 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -375,6 +375,7 @@ authors. luvchurchill
luvchurchill

πŸ’» Ze-en Xiong
Ze-en Xiong

πŸ–‹ Parnav Harinathan
Parnav Harinathan

πŸ–‹ + 0Ahmed-0
0Ahmed-0

πŸ–‹ From d53ae18918a0e2f65f981938326cc8c03a862595 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 13:40:37 +0000 Subject: [PATCH 59/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 60f034ef..0328a51c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2658,6 +2658,15 @@ "contributions": [ "content" ] + }, + { + "login": "0Ahmed-0", + "name": "0Ahmed-0", + "avatar_url": "https://avatars.githubusercontent.com/u/111569638?v=4", + "profile": "https://github.com/0Ahmed-0", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From d8ecf4bc2d34a10149999a7974d5ba71625fab90 Mon Sep 17 00:00:00 2001 From: liv Date: Fri, 15 Mar 2024 15:01:32 +0100 Subject: [PATCH 60/68] fix: clean up "return" wording in iterators4 --- exercises/18_iterators/iterators4.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/18_iterators/iterators4.rs b/exercises/18_iterators/iterators4.rs index 79e1692b..3c0724e9 100644 --- a/exercises/18_iterators/iterators4.rs +++ b/exercises/18_iterators/iterators4.rs @@ -8,7 +8,7 @@ pub fn factorial(num: u64) -> u64 { // Complete this function to return the factorial of num // Do not use: - // - return + // - early returns (using the `return` keyword explicitly) // Try not to use: // - imperative style loops (for, while) // - additional variables From ae69f423cd3a3cb795e0864316dfaf6198fd511c Mon Sep 17 00:00:00 2001 From: guizo792 <95940388+guizo792@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:36:28 +0000 Subject: [PATCH 61/68] Update exercises/03_if/if1.rs Co-authored-by: liv --- exercises/03_if/if1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/03_if/if1.rs b/exercises/03_if/if1.rs index 38d283c2..d2afccf8 100644 --- a/exercises/03_if/if1.rs +++ b/exercises/03_if/if1.rs @@ -6,7 +6,7 @@ pub fn bigger(a: i32, b: i32) -> i32 { // Complete this function to return the bigger number! - // If both numbers are equal, any of them is returned. + // If both numbers are equal, any of them can be returned. // Do not use: // - another function call // - additional variables From 60f44cc5097471d76e54761e36a7bddfdbcfb4fd Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:56:54 +0000 Subject: [PATCH 62/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index a74e77f5..5515745f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -376,6 +376,7 @@ authors. Ze-en Xiong
Ze-en Xiong

πŸ–‹ Parnav Harinathan
Parnav Harinathan

πŸ–‹ 0Ahmed-0
0Ahmed-0

πŸ–‹ + guizo792
guizo792

πŸ–‹ From d4233f816674a98bc603bb551d6729eb92f5e75e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:56:55 +0000 Subject: [PATCH 63/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0328a51c..2f6cd732 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2667,6 +2667,15 @@ "contributions": [ "content" ] + }, + { + "login": "guizo792", + "name": "guizo792", + "avatar_url": "https://avatars.githubusercontent.com/u/95940388?v=4", + "profile": "https://github.com/guizo792", + "contributions": [ + "content" + ] } ], "contributorsPerLine": 8, From 80388c042bd1c0048fccf1cf739486642969b8a7 Mon Sep 17 00:00:00 2001 From: Kazuki Matsuo Date: Sat, 16 Mar 2024 13:56:34 +0900 Subject: [PATCH 64/68] fix(verify): show stdout of the last line --- src/verify.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/verify.rs b/src/verify.rs index 8a2ad49f..aee2afa3 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -38,6 +38,15 @@ pub fn verify<'a>( percentage += 100.0 / total as f32; bar.inc(1); bar.set_message(format!("({:.1} %)", percentage)); + if bar.position() == total as u64 { + println!( + "Progress: You completed {} / {} exercises ({:.1} %).", + bar.position(), + total, + percentage + ); + bar.finish(); + } } Ok(()) } From a07172a069ea0a70e70256bf981d33c5b03acfb0 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:19:36 +0000 Subject: [PATCH 65/68] docs: update AUTHORS.md [skip ci] --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 5515745f..00122e07 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -377,6 +377,7 @@ authors. Parnav Harinathan
Parnav Harinathan

πŸ–‹ 0Ahmed-0
0Ahmed-0

πŸ–‹ guizo792
guizo792

πŸ–‹ + Kazuki Matsuo
Kazuki Matsuo

πŸ’» From e1fa6cf30bfa82ce3cf3882a146f9fd7c434692d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:19:37 +0000 Subject: [PATCH 66/68] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 2f6cd732..f2446f1f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2676,6 +2676,15 @@ "contributions": [ "content" ] + }, + { + "login": "kazu728", + "name": "Kazuki Matsuo", + "avatar_url": "https://avatars.githubusercontent.com/u/34614358?v=4", + "profile": "https://github.com/kazu728", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 8, From 71700c506c34af636fc9d4098b5bebc21dfe9a3c Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 18 Mar 2024 01:12:37 +0100 Subject: [PATCH 67/68] Remove unneeded Arc --- exercises/20_threads/threads3.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/exercises/20_threads/threads3.rs b/exercises/20_threads/threads3.rs index 91006bbc..acb97b4b 100644 --- a/exercises/20_threads/threads3.rs +++ b/exercises/20_threads/threads3.rs @@ -27,22 +27,18 @@ impl Queue { } fn send_tx(q: Queue, tx: mpsc::Sender) -> () { - let qc = Arc::new(q); - let qc1 = Arc::clone(&qc); - let qc2 = Arc::clone(&qc); - thread::spawn(move || { - for val in &qc1.first_half { + for val in q.first_half { println!("sending {:?}", val); - tx.send(*val).unwrap(); + tx.send(val).unwrap(); thread::sleep(Duration::from_secs(1)); } }); thread::spawn(move || { - for val in &qc2.second_half { + for val in q.second_half { println!("sending {:?}", val); - tx.send(*val).unwrap(); + tx.send(val).unwrap(); thread::sleep(Duration::from_secs(1)); } }); From 1fe32a7ff2250ae893fdd54b394e6521d32dd024 Mon Sep 17 00:00:00 2001 From: mo8it Date: Mon, 18 Mar 2024 01:44:25 +0100 Subject: [PATCH 68/68] Fix the sysroot path when it contains whitespaces --- src/project.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/project.rs b/src/project.rs index bcbd7ada..00fc304d 100644 --- a/src/project.rs +++ b/src/project.rs @@ -2,7 +2,7 @@ use glob::glob; use serde::{Deserialize, Serialize}; use std::env; use std::error::Error; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::process::Command; /// Contains the structure of resulting rust-project.json file @@ -79,21 +79,24 @@ impl RustAnalyzerProject { .output()? .stdout; - let toolchain = String::from_utf8_lossy(&toolchain); - let mut whitespace_iter = toolchain.split_whitespace(); + let toolchain = String::from_utf8(toolchain)?; + let toolchain = toolchain.trim_end(); - let toolchain = whitespace_iter.next().unwrap_or(&toolchain); + println!("Determined toolchain: {toolchain}\n"); - println!("Determined toolchain: {}\n", &toolchain); - - self.sysroot_src = (std::path::Path::new(toolchain) + let Ok(path) = Path::new(toolchain) .join("lib") .join("rustlib") .join("src") .join("rust") .join("library") - .to_string_lossy()) - .to_string(); + .into_os_string() + .into_string() + else { + return Err("The sysroot path is invalid UTF8".into()); + }; + self.sysroot_src = path; + Ok(()) } }