diff options
| author | olivia <olivia@fastmail.com> | 2018-05-22 22:26:09 +0200 |
|---|---|---|
| committer | olivia <olivia@fastmail.com> | 2018-05-22 22:26:09 +0200 |
| commit | 4eca18050f21b3bc69477118845903ec61283d4f (patch) | |
| tree | d3c1d3a5b1620ed13f2336cbff0a189762fb5f0f /src/main.rs | |
| parent | 69ff4a8b2554f4113b759a7935cb611aa13ab9ad (diff) | |
put it in a separate file
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/main.rs b/src/main.rs index 133bdf4..02f0227 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,41 +2,10 @@ extern crate quicli; extern crate ansi_term; -use ansi_term::Color::{Green, Red, Yellow}; +use ansi_term::Color::Yellow; use quicli::prelude::*; -use std::fmt::Display; - -pub fn verify<T: PartialEq + Display>(left: T, right: T) { - if left == right { - println!("{} {} == {}", Green.bold().paint("PASS"), left, right); - } else { - println!( - "{} You submitted {}, but that's not correct!", - Red.bold().paint("FAIL"), - left - ); - println!(" Please correct your code to make this test pass!"); - } -} - -pub fn verify_easy<T: PartialEq + Display>(left: T, right: T) { - if left == right { - println!("{} {} == {}", Green.bold().paint("PASS"), left, right); - } else { - println!( - "{} You submitted {}, but that's not correct!", - Red.bold().paint("FAIL"), - left - ); - println!(" Expected: {}", right); - println!(" Please correct your code to make this test pass!"); - } -} - -pub fn title(s: &str) { - println!("{} {}", Yellow.bold().paint("RUN"), s); -} +mod helpers; mod about_variables; #[derive(Debug, StructOpt)] |
