From d9946a91d429b2de2d0e21a2f346821f29c6ec5a Mon Sep 17 00:00:00 2001 From: olivia Date: Wed, 16 May 2018 15:23:14 +0200 Subject: make the example work --- src/main.rs | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 3adc6bd..525baa4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,34 +2,10 @@ extern crate quicli; extern crate ansi_term; -use ansi_term::Colour::{Green, Red, Yellow}; use quicli::prelude::*; +use ansi_term::Color::Yellow; -macro_rules! verify { - ($left:expr, $right:expr, $str:expr) => { - if ($left == $right) { - println!("{} {}", Green.bold().paint("PASS"), $str); - } else { - println!("{} {}", Red.bold().paint("FAIL"), $str); - println!("\tYou submitted {}, but that's not correct!", $left); - println!("\tPlease correct your code to make this test pass!"); - } - }; -} - -macro_rules! verify_easy { - ($str:expr, $left:expr, $right:expr) => { - if ($left == $right) { - println!("{} {}", Green.bold().paint("PASS"), $str); - } else { - println!("{} {}", Red.bold().paint("FAIL"), $str); - println!("\tExpected: {}", $right); - println!("\tGot: {}", $left); - println!("\tPlease correct your code to make this test pass!"); - } - }; -} - +#[macro_use] mod macros; mod about_variables; #[derive(Debug, StructOpt)] @@ -41,5 +17,5 @@ main!(|args: Cli| if let Some(e) = args.exercise { println!("selected {}", e); } else { println!("Welcome to {}", Yellow.paint("rustlings")); - verify!(2, 1, "One equals one"); + about_variables::exec(); }); -- cgit v1.2.3