Replace unstable 'chars' by 'bytes'
As this is a paththrough function and all important control chars are in the byte range, chars is not necessary.
This commit is contained in:
parent
22ef240967
commit
4d21e7f3e4
|
@ -15,12 +15,12 @@ impl<R: Read> ReadExt for R {
|
||||||
let _raw = try!(writer.into_raw_mode());
|
let _raw = try!(writer.into_raw_mode());
|
||||||
let mut string = String::with_capacity(30);
|
let mut string = String::with_capacity(30);
|
||||||
|
|
||||||
for c in self.chars() {
|
for c in self.bytes() {
|
||||||
match c {
|
match c {
|
||||||
Err(_) => return Err(TerminalError::StdinError),
|
Err(_) => return Err(TerminalError::StdinError),
|
||||||
Ok('\0') | Ok('\x03') | Ok('\x04') => return Ok(None),
|
Ok(b'\0') | Ok(b'\x03') | Ok(b'\x04') => return Ok(None),
|
||||||
Ok('\n') | Ok('\r') => return Ok(Some(string)),
|
Ok(b'\n') | Ok(b'\r') => return Ok(Some(string)),
|
||||||
Ok(c) => string.push(c),
|
Ok(c) => string.push(c as char),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![feature(io)]
|
|
||||||
#![feature(libc)]
|
#![feature(libc)]
|
||||||
|
|
||||||
#[warn(missing_docs)]
|
#[warn(missing_docs)]
|
||||||
|
|
Loading…
Reference in New Issue