diff --git a/Cargo.toml b/Cargo.toml index ada7bca..19101a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" authors = ["Ticki "] [dependencies] +libc = "0.2.8" diff --git a/src/extra.rs b/src/extra.rs index eacd4d8..36602b4 100644 --- a/src/extra.rs +++ b/src/extra.rs @@ -15,12 +15,12 @@ impl ReadExt for R { let _raw = try!(writer.into_raw_mode()); let mut string = String::with_capacity(30); - for c in self.chars() { + for c in self.bytes() { match c { Err(_) => return Err(TerminalError::StdinError), - Ok('\0') | Ok('\x03') | Ok('\x04') => return Ok(None), - Ok('\n') | Ok('\r') => return Ok(Some(string)), - Ok(c) => string.push(c), + Ok(b'\0') | Ok(b'\x03') | Ok(b'\x04') => return Ok(None), + Ok(b'\n') | Ok(b'\r') => return Ok(Some(string)), + Ok(c) => string.push(c as char), } } diff --git a/src/lib.rs b/src/lib.rs index c29790d..ae67d23 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,3 @@ -#![feature(io)] -#![feature(libc)] - #[warn(missing_docs)] #[cfg(not(target_os = "redox"))]