mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
[libs] Remove unread_byte method from core::io::Reader
Method isn't used. See discussion on #2738 and #4031 Closes #2738
This commit is contained in:
@@ -44,9 +44,6 @@ pub trait Reader {
|
||||
/// Read a single byte, returning a negative value for EOF or read error.
|
||||
fn read_byte() -> int;
|
||||
|
||||
/// Behaves like the libc function ungetc.
|
||||
fn unread_byte(int);
|
||||
|
||||
/// Return whether the stream is currently at EOF position.
|
||||
fn eof() -> bool;
|
||||
|
||||
@@ -413,7 +410,6 @@ fn read(bytes: &[mut u8], len: uint) -> uint {
|
||||
}
|
||||
}
|
||||
fn read_byte() -> int { return libc::fgetc(self) as int; }
|
||||
fn unread_byte(byte: int) { libc::ungetc(byte as c_int, self); }
|
||||
fn eof() -> bool { return libc::feof(self) != 0 as c_int; }
|
||||
fn seek(offset: int, whence: SeekStyle) {
|
||||
assert libc::fseek(self, offset as c_long, convert_whence(whence))
|
||||
@@ -430,7 +426,6 @@ fn read(bytes: &[mut u8], len: uint) -> uint {
|
||||
self.base.read(bytes, len)
|
||||
}
|
||||
fn read_byte() -> int { self.base.read_byte() }
|
||||
fn unread_byte(byte: int) { self.base.unread_byte(byte); }
|
||||
fn eof() -> bool { self.base.eof() }
|
||||
fn seek(off: int, whence: SeekStyle) { self.base.seek(off, whence) }
|
||||
fn tell() -> uint { self.base.tell() }
|
||||
@@ -498,8 +493,6 @@ fn read_byte() -> int {
|
||||
self.pos += 1u;
|
||||
return b as int;
|
||||
}
|
||||
// FIXME (#2738): implement this
|
||||
fn unread_byte(_byte: int) { error!("Unimplemented: unread_byte"); fail; }
|
||||
fn eof() -> bool { self.pos == self.bytes.len() }
|
||||
fn seek(offset: int, whence: SeekStyle) {
|
||||
let pos = self.pos;
|
||||
|
||||
Reference in New Issue
Block a user