aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-04-24 14:05:38 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-04-24 14:05:38 +0200
commitfa4aa36c9ee56dbcc35be3fe868e77c3561e2433 (patch)
treeb4a0eb8f80acf1b2b0456bdf14b510e6c2af0f17
parentb6252d9de2f487982193569212e301fb598593dd (diff)
parente12f06ad485404a2b0d4ce4bb58ee174e9102b3a (diff)
downloadglutin-fa4aa36c9ee56dbcc35be3fe868e77c3561e2433.tar.gz
glutin-fa4aa36c9ee56dbcc35be3fe868e77c3561e2433.zip
Merge pull request #392 from tomaka/fix-example
Fix and re-enable the fullscreen example
-rw-r--r--examples/fullscreen.rs (renamed from examples-disabled/fullscreen.rs)8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples-disabled/fullscreen.rs b/examples/fullscreen.rs
index 3b9e2c1..d64224b 100644
--- a/examples-disabled/fullscreen.rs
+++ b/examples/fullscreen.rs
@@ -4,7 +4,7 @@ extern crate android_glue;
extern crate glutin;
-use std::old_io::stdio::stdin;
+use std::io;
mod support;
@@ -23,8 +23,10 @@ fn main() {
}
print!("Please write the number of the monitor to use: ");
- let num = stdin().read_line().unwrap().as_slice().trim().parse()
- .ok().expect("Please enter a number");
+
+ let mut num = String::new();
+ io::stdin().read_line(&mut num).unwrap();
+ let num = num.trim().parse().ok().expect("Please enter a number");
let monitor = glutin::get_available_monitors().nth(num).expect("Please enter a valid ID");
println!("Using {:?}", monitor.get_name());