Skip to content
Snippets Groups Projects
Commit a3cc2276 authored by Jeremy Soller's avatar Jeremy Soller Committed by ticki
Browse files

Convert VarError to io::Error (#41)

parent f9928bd6
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,8 @@ pub fn is_tty<T: AsRawFd>(_stream: T) -> bool {
#[cfg(target_os = "redox")]
pub fn get_tty() -> io::Result<fs::File> {
use std::env;
fs::OpenOptions::new().read(true).write(true).open(try!(env::var("TTY")))
let tty = try!(env::var("TTY").map_err(|x| io::Error::new(io::ErrorKind::NotFound, x)));
fs::OpenOptions::new().read(true).write(true).open(tty)
}
/// Get the TTY device.
......
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