diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..076b5dd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: rust +cache: cargo +rust: + - stable + - beta + - nightly +script: + - cargo build --verbose + - cargo test --verbose + - cargo test --release --verbose diff --git a/examples/rainbow.rs b/examples/rainbow.rs index 03c2282..e6ee27b 100644 --- a/examples/rainbow.rs +++ b/examples/rainbow.rs @@ -1,5 +1,3 @@ -#![feature(step_by)] - extern crate termion; use termion::event::Key; @@ -10,8 +8,10 @@ use std::io::{Write, stdout, stdin}; fn rainbow(stdout: &mut W, blue: u8) { write!(stdout, "{}{}", termion::cursor::Goto(1, 1), termion::clear::All).unwrap(); - for red in (0..255).step_by(8 as u8) { - for green in (0..255).step_by(4) { + for red in 0..32 { + let red = red * 8; + for green in 0..64 { + let green = green * 4; write!(stdout, "{} ", termion::color::Bg(termion::color::Rgb(red, green, blue))).unwrap(); } write!(stdout, "\n\r").unwrap(); @@ -24,7 +24,7 @@ fn main() { let stdin = stdin(); let mut stdout = stdout().into_raw_mode().unwrap(); - writeln!(stdout, "{}{}{}Use the arrow keys to change the blue in the rainbow.", + writeln!(stdout, "{}{}{}Use the up/down arrow keys to change the blue in the rainbow.", termion::clear::All, termion::cursor::Goto(1, 1), termion::cursor::Hide).unwrap();