Skip to content

Commit

Permalink
[libs] Remove unread_byte method from core::io::Reader
Browse files Browse the repository at this point in the history
Method isn't used. See discussion on rust-lang#2738 and rust-lang#4031

Closes rust-lang#2738
  • Loading branch information
catamorphism committed Nov 24, 2012
1 parent fa66f3e commit 455d73c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -413,7 +410,6 @@ impl *libc::FILE: Reader {
}
}
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))
Expand All @@ -430,7 +426,6 @@ impl<T: Reader, C> {base: T, cleanup: C}: Reader {
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() }
Expand Down Expand Up @@ -498,8 +493,6 @@ impl BytesReader: Reader {
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;
Expand Down

0 comments on commit 455d73c

Please sign in to comment.