Skip to content

Commit 455d73c

Browse files
committed
[libs] Remove unread_byte method from core::io::Reader
Method isn't used. See discussion on #2738 and #4031 Closes #2738
1 parent fa66f3e commit 455d73c

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/libcore/io.rs

-7
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ pub trait Reader {
4444
/// Read a single byte, returning a negative value for EOF or read error.
4545
fn read_byte() -> int;
4646

47-
/// Behaves like the libc function ungetc.
48-
fn unread_byte(int);
49-
5047
/// Return whether the stream is currently at EOF position.
5148
fn eof() -> bool;
5249

@@ -413,7 +410,6 @@ impl *libc::FILE: Reader {
413410
}
414411
}
415412
fn read_byte() -> int { return libc::fgetc(self) as int; }
416-
fn unread_byte(byte: int) { libc::ungetc(byte as c_int, self); }
417413
fn eof() -> bool { return libc::feof(self) != 0 as c_int; }
418414
fn seek(offset: int, whence: SeekStyle) {
419415
assert libc::fseek(self, offset as c_long, convert_whence(whence))
@@ -430,7 +426,6 @@ impl<T: Reader, C> {base: T, cleanup: C}: Reader {
430426
self.base.read(bytes, len)
431427
}
432428
fn read_byte() -> int { self.base.read_byte() }
433-
fn unread_byte(byte: int) { self.base.unread_byte(byte); }
434429
fn eof() -> bool { self.base.eof() }
435430
fn seek(off: int, whence: SeekStyle) { self.base.seek(off, whence) }
436431
fn tell() -> uint { self.base.tell() }
@@ -498,8 +493,6 @@ impl BytesReader: Reader {
498493
self.pos += 1u;
499494
return b as int;
500495
}
501-
// FIXME (#2738): implement this
502-
fn unread_byte(_byte: int) { error!("Unimplemented: unread_byte"); fail; }
503496
fn eof() -> bool { self.pos == self.bytes.len() }
504497
fn seek(offset: int, whence: SeekStyle) {
505498
let pos = self.pos;

0 commit comments

Comments
 (0)