Skip to content

Commit 88ec6f6

Browse files
committed
Auto merge of #230 - jrvidal:master, r=fmoko
Changes the execution mode for `watch`, asking for user input We've [observed](https://hackmd.io/-cK6aPhnTwiCiI7u6k0xug?both) that learners can get confused when they do get everything right, but they _still_ get errors... which come from the next exercise, no the one they just edited. This PR changes it so they have to confirm they want to move forward by removing the `I AM NOT DONE` comment. ![Screenshot at 2019-11-11 15:13:39](https://user-images.githubusercontent.com/1636604/68593566-0abd3900-0496-11ea-9e9d-6c43b91bf21d.png) * [ ] The particular string is of course subject to bikeshed. ### Alternatives/doubts * The coolest solution I could imagine would involve a proc-macro attribute `#![ready(false)]` that they could edit once they're done, but it's a bit complicated to set up. * For now I've put `I AM NOT DONE` everywhere, I think it's what make more sense.
2 parents a47a621 + 2cdd612 commit 88ec6f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+309
-12
lines changed

Cargo.lock

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ indicatif = "0.9.0"
1010
console = "0.6.2"
1111
notify = "4.0.0"
1212
toml = "0.4.10"
13+
regex = "1.1.6"
1314
serde = {version = "1.0.10", features = ["derive"]}
1415

1516
[[bin]]
@@ -18,3 +19,4 @@ path = "src/main.rs"
1819

1920
[dev-dependencies]
2021
assert_cmd = "0.11.0"
22+
glob = "0.3.0"

exercises/enums/enums1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// enums1.rs
22
// Make me compile! Scroll down for hints!
33

4+
// I AM NOT DONE
5+
46
#[derive(Debug)]
57
enum Message {
68
// TODO: define a few types of messages as used below

exercises/enums/enums2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// enums2.rs
22
// Make me compile! Scroll down for hints
33

4+
// I AM NOT DONE
5+
46
#[derive(Debug)]
57
enum Message {
68
// TODO: define the different variants used below

exercises/enums/enums3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// enums3.rs
22
// Address all the TODOs to make the tests pass!
33

4+
// I AM NOT DONE
5+
46
enum Message {
57
// TODO: implement the message variant types based on their usage below
68
}

exercises/error_handling/errors1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// this function to have.
77
// Scroll down for hints!!!
88

9+
// I AM NOT DONE
10+
911
pub fn generate_nametag_text(name: String) -> Option<String> {
1012
if name.len() > 0 {
1113
Some(format!("Hi! My name is {}", name))

exercises/error_handling/errors2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// There are at least two ways to implement this that are both correct-- but
1717
// one is a lot shorter! Scroll down for hints to both ways.
1818

19+
// I AM NOT DONE
20+
1921
use std::num::ParseIntError;
2022

2123
pub fn total_cost(item_quantity: &str) -> Result<i32, ParseIntError> {

exercises/error_handling/errors3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// `total_cost` function from the previous exercise. It's not working though!
44
// Why not? What should we do to fix it? Scroll for hints!
55

6+
// I AM NOT DONE
7+
68
use std::num::ParseIntError;
79

810
fn main() {

exercises/error_handling/errorsn.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
//
1616
// Scroll down for hints :)
1717

18+
// I AM NOT DONE
19+
1820
use std::error;
1921
use std::fmt;
2022
use std::io;

exercises/error_handling/option1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// on `None`. Handle this in a more graceful way than calling `unwrap`!
55
// Scroll down for hints :)
66

7+
// I AM NOT DONE
8+
79
pub fn pop_too_much() -> bool {
810
let mut list = vec![3];
911

exercises/error_handling/result1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// result1.rs
22
// Make this test pass! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
#[derive(PartialEq, Debug)]
57
struct PositiveNonzeroInteger(u64);
68

exercises/functions/functions1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// functions1.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
call_me();
68
}

exercises/functions/functions2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// functions2.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
call_me(3);
68
}

exercises/functions/functions3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// functions3.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
call_me();
68
}

exercises/functions/functions4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// This store is having a sale where if the price is an even number, you get
55
// 10 (money unit) off, but if it's an odd number, it's 3 (money unit) less.
66

7+
// I AM NOT DONE
8+
79
fn main() {
810
let original_price = 51;
911
println!("Your sale price is {}", sale_price(original_price));

exercises/functions/functions5.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// functions5.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
let answer = square(3);
68
println!("The answer is {}", answer);

exercises/if/if1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// if1.rs
22

3+
// I AM NOT DONE
4+
35
pub fn bigger(a: i32, b: i32) -> i32 {
46
// Complete this function to return the bigger number!
57
// Do not use:

exercises/macros/macros1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// macros1.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
macro_rules! my_macro {
57
() => {
68
println!("Check out my macro!");

exercises/macros/macros2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// macros2.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
my_macro!();
68
}

exercises/macros/macros3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// macros3.rs
22
// Make me compile, without taking the macro out of the module! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
mod macros {
57
macro_rules! my_macro {
68
() => {

exercises/macros/macros4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// macros4.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
macro_rules! my_macro {
57
() => {
68
println!("Check out my macro!");

exercises/modules/modules1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// modules1.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
mod sausage_factory {
57
fn make_sausage() {
68
println!("sausage!");

exercises/modules/modules2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// modules2.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
mod delicious_snacks {
57
use self::fruits::PEAR as fruit;
68
use self::veggies::CUCUMBER as veggie;

exercises/move_semantics/move_semantics1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// move_semantics1.rs
22
// Make me compile! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
let vec0 = Vec::new();
68

exercises/move_semantics/move_semantics2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// move_semantics2.rs
22
// Make me compile without changing line 10! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
let vec0 = Vec::new();
68

exercises/move_semantics/move_semantics3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// (no lines with multiple semicolons necessary!)
44
// Scroll down for hints :)
55

6+
// I AM NOT DONE
7+
68
fn main() {
79
let vec0 = Vec::new();
810

exercises/move_semantics/move_semantics4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// in `fn main`, we instead create it within `fn fill_vec` and transfer the
44
// freshly created vector from fill_vec to its caller. Scroll for hints!
55

6+
// I AM NOT DONE
7+
68
fn main() {
79
let vec0 = Vec::new();
810

exercises/primitive_types/primitive_types1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Fill in the rest of the line that has code missing!
33
// No hints, there's no tricks, just get used to typing these :)
44

5+
// I AM NOT DONE
6+
57
fn main() {
68
// Booleans (`bool`)
79

exercises/primitive_types/primitive_types2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Fill in the rest of the line that has code missing!
33
// No hints, there's no tricks, just get used to typing these :)
44

5+
// I AM NOT DONE
6+
57
fn main() {
68
// Characters (`char`)
79

exercises/primitive_types/primitive_types3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Create an array with at least 100 elements in it where the ??? is.
33
// Scroll down for hints!
44

5+
// I AM NOT DONE
6+
57
fn main() {
68
let a = ???
79

exercises/primitive_types/primitive_types4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Get a slice out of Array a where the ??? is so that the `if` statement
33
// returns true. Scroll down for hints!!
44

5+
// I AM NOT DONE
6+
57
#[test]
68
fn main() {
79
let a = [1, 2, 3, 4, 5];

exercises/primitive_types/primitive_types5.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Destructure the `cat` tuple so that the println will work.
33
// Scroll down for hints!
44

5+
// I AM NOT DONE
6+
57
fn main() {
68
let cat = ("Furry McFurson", 3.5);
79
let /* your pattern here */ = cat;

exercises/primitive_types/primitive_types6.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// You can put this right into the `println!` where the ??? is.
44
// Scroll down for hints!
55

6+
// I AM NOT DONE
7+
68
fn main() {
79
let numbers = (1, 2, 3);
810
println!("The second number is {}", ???);

exercises/standard_library_types/arc1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// somewhere. Try not to create any copies of the `numbers` Vec!
55
// Scroll down for hints :)
66

7+
// I AM NOT DONE
8+
79
use std::sync::Arc;
810
use std::thread;
911

exercises/standard_library_types/iterators2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Step 3. Apply the `capitalize_first` function again to a list, but try and ensure it returns a single string
66
// As always, there are hints below!
77

8+
// I AM NOT DONE
9+
810
pub fn capitalize_first(input: &str) -> String {
911
let mut c = input.chars();
1012
match c.next() {

exercises/standard_library_types/iterators3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// a major hint.
99
// Have fun :-)
1010

11+
// I AM NOT DONE
12+
1113
#[derive(Debug, PartialEq, Eq)]
1214
pub enum DivisionError {
1315
NotDivisible(NotDivisibleError),

exercises/standard_library_types/iterators4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// iterators4.rs
22

3+
// I AM NOT DONE
4+
35
pub fn factorial(num: u64) -> u64 {
46
// Complete this function to return factorial of num
57
// Do not use:

exercises/strings/strings1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// strings1.rs
22
// Make me compile without changing the function signature! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
let answer = current_favorite_color();
68
println!("My current favorite color is {}", answer);

exercises/strings/strings2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// strings2.rs
22
// Make me compile without changing the function signature! Scroll down for hints :)
33

4+
// I AM NOT DONE
5+
46
fn main() {
57
let word = String::from("green"); // Try not changing this line :)
68
if is_a_color_word(word) {

exercises/structs/structs1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// structs1.rs
22
// Address all the TODOs to make the tests pass!
33

4+
// I AM NOT DONE
5+
46
struct ColorClassicStruct {
57
// TODO: Something goes here
68
}

exercises/structs/structs2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Address all the TODOs to make the tests pass!
33
// No hints, just do it!
44

5+
// I AM NOT DONE
6+
57
#[derive(Debug)]
68
struct Order {
79
name: String,

0 commit comments

Comments
 (0)