Skip to content
Snippets Groups Projects
Commit bf1a6ecc authored by Ticki's avatar Ticki
Browse files

Amend #15

parent f5936c00
No related branches found
No related tags found
No related merge requests found
......@@ -50,8 +50,8 @@ pub fn terminal_size() -> io::Result<(usize, usize)> {
pub fn terminal_size() -> io::Result<(usize, usize)> {
use std::env;
let width = env::var("COLUMNS").unwrap_or(String::new()).parse::<usize>().unwrap_or(0);
let height = env::var("LINES").unwrap_or(String::new()).parse::<usize>().unwrap_or(0);
let width = try!(env::var("COLUMNS").map_err(|x| io::Error::new(io::ErrorKind::NotFound, x))).parse().unwrap_or(0);
let height = try!(env::var("LINES").map_err(|x| io::Error::new(io::ErrorKind::NotFound, x))).parse().unwrap_or(0);
Ok((width, height))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment