@@ -44,9 +44,6 @@ pub trait Reader {
44
44
/// Read a single byte, returning a negative value for EOF or read error.
45
45
fn read_byte ( ) -> int ;
46
46
47
- /// Behaves like the libc function ungetc.
48
- fn unread_byte ( int ) ;
49
-
50
47
/// Return whether the stream is currently at EOF position.
51
48
fn eof ( ) -> bool ;
52
49
@@ -413,7 +410,6 @@ impl *libc::FILE: Reader {
413
410
}
414
411
}
415
412
fn read_byte ( ) -> int { return libc:: fgetc ( self ) as int ; }
416
- fn unread_byte ( byte : int ) { libc:: ungetc ( byte as c_int , self ) ; }
417
413
fn eof ( ) -> bool { return libc:: feof ( self ) != 0 as c_int ; }
418
414
fn seek ( offset : int , whence : SeekStyle ) {
419
415
assert libc:: fseek ( self , offset as c_long , convert_whence ( whence) )
@@ -430,7 +426,6 @@ impl<T: Reader, C> {base: T, cleanup: C}: Reader {
430
426
self . base . read ( bytes, len)
431
427
}
432
428
fn read_byte ( ) -> int { self . base . read_byte ( ) }
433
- fn unread_byte ( byte : int ) { self . base . unread_byte ( byte) ; }
434
429
fn eof ( ) -> bool { self . base . eof ( ) }
435
430
fn seek ( off : int , whence : SeekStyle ) { self . base . seek ( off, whence) }
436
431
fn tell ( ) -> uint { self . base . tell ( ) }
@@ -498,8 +493,6 @@ impl BytesReader: Reader {
498
493
self.pos += 1u;
499
494
return b as int;
500
495
}
501
- // FIXME (#2738): implement this
502
- fn unread_byte(_byte: int) { error!(" Unimplemented : unread_byte") ; fail; }
503
496
fn eof() -> bool { self.pos == self.bytes.len() }
504
497
fn seek(offset: int, whence: SeekStyle) {
505
498
let pos = self.pos;
0 commit comments