Update lorem example

Load text before initializing ncurses.
This commit is contained in:
Alexandre Bury 2015-05-25 11:37:28 -07:00
parent 222c4465d9
commit cb03f79e24

View File

@ -7,13 +7,13 @@ use std::fs::File;
use std::io::Read; use std::io::Read;
fn main() { fn main() {
let mut siv = Cursive::new();
// Read some long text from a file. // Read some long text from a file.
let mut file = File::open("assets/lorem.txt").unwrap(); let mut file = File::open("assets/lorem.txt").unwrap();
let mut content = String::new(); let mut content = String::new();
file.read_to_string(&mut content).unwrap(); file.read_to_string(&mut content).unwrap();
let mut siv = Cursive::new();
// We can quit by pressing q // We can quit by pressing q
siv.add_global_callback('q' as i32, |s| s.quit()); siv.add_global_callback('q' as i32, |s| s.quit());