mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 15:26:29 +00:00
release: 4.6.0
This commit is contained in:
parent
c2ed98deb3
commit
d57c183028
5 changed files with 86 additions and 57 deletions
26
CHANGELOG.md
26
CHANGELOG.md
|
@ -1,3 +1,29 @@
|
||||||
|
<a name="4.6.0"></a>
|
||||||
|
## 4.6.0 (2021-09-25)
|
||||||
|
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
|
||||||
|
* add advanced_errs2 ([abd6b70c](https://github.com/rust-lang/rustlings/commit/abd6b70c72dc6426752ff41f09160b839e5c449e))
|
||||||
|
* add advanced_errs1 ([882d535b](https://github.com/rust-lang/rustlings/commit/882d535ba8628d5e0b37e8664b3e2f26260b2671))
|
||||||
|
* Add a farewell message when quitting `watch` ([1caef0b4](https://github.com/rust-lang/rustlings/commit/1caef0b43494c8b8cdd6c9260147e70d510f1aca))
|
||||||
|
* add more watch commands ([a7dc080b](https://github.com/rust-lang/rustlings/commit/a7dc080b95e49146fbaafe6922a6de2f8cb1582a), closes [#842](https://github.com/rust-lang/rustlings/issues/842))
|
||||||
|
* **modules:** update exercises, add modules3 (#822) ([dfd2fab4](https://github.com/rust-lang/rustlings/commit/dfd2fab4f33d1bf59e2e5ee03123c0c9a67a9481))
|
||||||
|
* **quiz1:** add default function name in comment (#838) ([0a11bad7](https://github.com/rust-lang/rustlings/commit/0a11bad71402b5403143d642f439f57931278c07))
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
|
||||||
|
* Correct small typo in exercises/conversions/from_str.rs ([86cc8529](https://github.com/rust-lang/rustlings/commit/86cc85295ae36948963ae52882e285d7e3e29323))
|
||||||
|
* **cli:** typo in exercise.rs (#848) ([06d5c097](https://github.com/rust-lang/rustlings/commit/06d5c0973a3dffa3c6c6f70acb775d4c6630323c))
|
||||||
|
* **from_str, try_from_into:** custom error types ([2dc93cad](https://github.com/rust-lang/rustlings/commit/2dc93caddad43821743e4903d89b355df58d7a49))
|
||||||
|
* **modules2:** fix typo (#835) ([1c3beb0a](https://github.com/rust-lang/rustlings/commit/1c3beb0a59178c950dc05fe8ee2346b017429ae0))
|
||||||
|
* **move_semantics5:**
|
||||||
|
* change &mut *y to &mut x (#814) ([d75759e8](https://github.com/rust-lang/rustlings/commit/d75759e829fdcd64ef071cf4b6eae2a011a7718b))
|
||||||
|
* Clarify instructions ([df25684c](https://github.com/rust-lang/rustlings/commit/df25684cb79f8413915e00b5efef29369849cef1))
|
||||||
|
* **quiz1:** Fix inconsistent wording (#826) ([03131a3d](https://github.com/rust-lang/rustlings/commit/03131a3d35d9842598150f9da817f7cc26e2669a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.5.0"></a>
|
<a name="4.5.0"></a>
|
||||||
## 4.5.0 (2021-07-07)
|
## 4.5.0 (2021-07-07)
|
||||||
|
|
||||||
|
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -541,7 +541,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustlings"
|
name = "rustlings"
|
||||||
version = "4.5.0"
|
version = "4.6.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argh",
|
"argh",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rustlings"
|
name = "rustlings"
|
||||||
version = "4.5.0"
|
version = "4.6.0"
|
||||||
authors = ["anastasie <ana@ana.st>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
authors = ["anastasie <ana@ana.st>", "Carol (Nichols || Goulding) <carol.nichols@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ When you get a permission denied message then you have to exclude the directory
|
||||||
Basically: Clone the repository at the latest tag, run `cargo install`.
|
Basically: Clone the repository at the latest tag, run `cargo install`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 4.5.0)
|
# find out the latest version at https://github.com/rust-lang/rustlings/releases/latest (on edit 4.6.0)
|
||||||
git clone -b 4.5.0 --depth 1 https://github.com/rust-lang/rustlings
|
git clone -b 4.6.0 --depth 1 https://github.com/rust-lang/rustlings
|
||||||
cd rustlings
|
cd rustlings
|
||||||
cargo install --force --path .
|
cargo install --force --path .
|
||||||
```
|
```
|
||||||
|
|
109
src/main.rs
109
src/main.rs
|
@ -11,7 +11,7 @@ use std::io::{self, prelude::*};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use std::sync::atomic::{AtomicBool, Ordering};
|
use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use std::sync::mpsc::{RecvTimeoutError, channel};
|
use std::sync::mpsc::{channel, RecvTimeoutError};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
@ -24,7 +24,7 @@ mod run;
|
||||||
mod verify;
|
mod verify;
|
||||||
|
|
||||||
// In sync with crate version
|
// In sync with crate version
|
||||||
const VERSION: &str = "4.5.0";
|
const VERSION: &str = "4.6.0";
|
||||||
|
|
||||||
#[derive(FromArgs, PartialEq, Debug)]
|
#[derive(FromArgs, PartialEq, Debug)]
|
||||||
/// Rustlings is a collection of small exercises to get you used to writing and reading Rust code
|
/// Rustlings is a collection of small exercises to get you used to writing and reading Rust code
|
||||||
|
@ -217,61 +217,64 @@ fn main() {
|
||||||
verify(&exercises, verbose).unwrap_or_else(|_| std::process::exit(1));
|
verify(&exercises, verbose).unwrap_or_else(|_| std::process::exit(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
Subcommands::Watch(_subargs) => {
|
Subcommands::Watch(_subargs) => match watch(&exercises, verbose) {
|
||||||
match watch(&exercises, verbose) {
|
Err(e) => {
|
||||||
Err(e) => {
|
println!(
|
||||||
println!(
|
"Error: Could not watch your progress. Error message was {:?}.",
|
||||||
"Error: Could not watch your progress. Error message was {:?}.",
|
e
|
||||||
e
|
);
|
||||||
);
|
println!("Most likely you've run out of disk space or your 'inotify limit' has been reached.");
|
||||||
println!("Most likely you've run out of disk space or your 'inotify limit' has been reached.");
|
std::process::exit(1);
|
||||||
std::process::exit(1);
|
|
||||||
}
|
|
||||||
Ok(WatchStatus::Finished) => {
|
|
||||||
println!(
|
|
||||||
"{emoji} All exercises completed! {emoji}",
|
|
||||||
emoji = Emoji("🎉", "★")
|
|
||||||
);
|
|
||||||
println!();
|
|
||||||
println!("+----------------------------------------------------+");
|
|
||||||
println!("| You made it to the Fe-nish line! |");
|
|
||||||
println!("+-------------------------- ------------------------+");
|
|
||||||
println!(" \\/ ");
|
|
||||||
println!(" ▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒ ");
|
|
||||||
println!(" ▒▒▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒▒▒ ");
|
|
||||||
println!(" ▒▒▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒▒▒ ");
|
|
||||||
println!(" ░░▒▒▒▒░░▒▒ ▒▒ ▒▒ ▒▒ ▒▒░░▒▒▒▒ ");
|
|
||||||
println!(" ▓▓▓▓▓▓▓▓ ▓▓ ▓▓██ ▓▓ ▓▓██ ▓▓ ▓▓▓▓▓▓▓▓ ");
|
|
||||||
println!(" ▒▒▒▒ ▒▒ ████ ▒▒ ████ ▒▒░░ ▒▒▒▒ ");
|
|
||||||
println!(" ▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒ ");
|
|
||||||
println!(" ▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓▒▒▓▓▒▒▒▒▒▒▒▒ ");
|
|
||||||
println!(" ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ");
|
|
||||||
println!(" ▒▒▒▒▒▒▒▒▒▒██▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒ ");
|
|
||||||
println!(" ▒▒ ▒▒▒▒▒▒▒▒▒▒██████▒▒▒▒▒▒▒▒▒▒ ▒▒ ");
|
|
||||||
println!(" ▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ");
|
|
||||||
println!(" ▒▒ ▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒ ");
|
|
||||||
println!(" ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ");
|
|
||||||
println!(" ▒▒ ▒▒ ▒▒ ▒▒ ");
|
|
||||||
println!();
|
|
||||||
println!("We hope you enjoyed learning about the various aspects of Rust!");
|
|
||||||
println!(
|
|
||||||
"If you noticed any issues, please don't hesitate to report them to our repo."
|
|
||||||
);
|
|
||||||
println!("You can also contribute your own exercises to help the greater community!");
|
|
||||||
println!();
|
|
||||||
println!("Before reporting an issue or contributing, please read our guidelines:");
|
|
||||||
println!("https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md");
|
|
||||||
}
|
|
||||||
Ok(WatchStatus::Unfinished) => {
|
|
||||||
println!("We hope you're enjoying learning about Rust!");
|
|
||||||
println!("If you want to continue working on the exercises at a later point, you can simply run `rustlings watch` again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
Ok(WatchStatus::Finished) => {
|
||||||
|
println!(
|
||||||
|
"{emoji} All exercises completed! {emoji}",
|
||||||
|
emoji = Emoji("🎉", "★")
|
||||||
|
);
|
||||||
|
println!();
|
||||||
|
println!("+----------------------------------------------------+");
|
||||||
|
println!("| You made it to the Fe-nish line! |");
|
||||||
|
println!("+-------------------------- ------------------------+");
|
||||||
|
println!(" \\/ ");
|
||||||
|
println!(" ▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒ ");
|
||||||
|
println!(" ▒▒▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒▒▒ ");
|
||||||
|
println!(" ▒▒▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒▒▒ ");
|
||||||
|
println!(" ░░▒▒▒▒░░▒▒ ▒▒ ▒▒ ▒▒ ▒▒░░▒▒▒▒ ");
|
||||||
|
println!(" ▓▓▓▓▓▓▓▓ ▓▓ ▓▓██ ▓▓ ▓▓██ ▓▓ ▓▓▓▓▓▓▓▓ ");
|
||||||
|
println!(" ▒▒▒▒ ▒▒ ████ ▒▒ ████ ▒▒░░ ▒▒▒▒ ");
|
||||||
|
println!(" ▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒ ");
|
||||||
|
println!(" ▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓▒▒▓▓▒▒▒▒▒▒▒▒ ");
|
||||||
|
println!(" ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ");
|
||||||
|
println!(" ▒▒▒▒▒▒▒▒▒▒██▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒ ");
|
||||||
|
println!(" ▒▒ ▒▒▒▒▒▒▒▒▒▒██████▒▒▒▒▒▒▒▒▒▒ ▒▒ ");
|
||||||
|
println!(" ▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ");
|
||||||
|
println!(" ▒▒ ▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒ ");
|
||||||
|
println!(" ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ");
|
||||||
|
println!(" ▒▒ ▒▒ ▒▒ ▒▒ ");
|
||||||
|
println!();
|
||||||
|
println!("We hope you enjoyed learning about the various aspects of Rust!");
|
||||||
|
println!(
|
||||||
|
"If you noticed any issues, please don't hesitate to report them to our repo."
|
||||||
|
);
|
||||||
|
println!(
|
||||||
|
"You can also contribute your own exercises to help the greater community!"
|
||||||
|
);
|
||||||
|
println!();
|
||||||
|
println!("Before reporting an issue or contributing, please read our guidelines:");
|
||||||
|
println!("https://github.com/rust-lang/rustlings/blob/main/CONTRIBUTING.md");
|
||||||
|
}
|
||||||
|
Ok(WatchStatus::Unfinished) => {
|
||||||
|
println!("We hope you're enjoying learning about Rust!");
|
||||||
|
println!("If you want to continue working on the exercises at a later point, you can simply run `rustlings watch` again");
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spawn_watch_shell(failed_exercise_hint: &Arc<Mutex<Option<String>>>, should_quit: Arc<AtomicBool>) {
|
fn spawn_watch_shell(
|
||||||
|
failed_exercise_hint: &Arc<Mutex<Option<String>>>,
|
||||||
|
should_quit: Arc<AtomicBool>,
|
||||||
|
) {
|
||||||
let failed_exercise_hint = Arc::clone(failed_exercise_hint);
|
let failed_exercise_hint = Arc::clone(failed_exercise_hint);
|
||||||
println!("Welcome to watch mode! You can type 'help' to get an overview of the commands you can use here.");
|
println!("Welcome to watch mode! You can type 'help' to get an overview of the commands you can use here.");
|
||||||
thread::spawn(move || loop {
|
thread::spawn(move || loop {
|
||||||
|
|
Loading…
Reference in a new issue