mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 15:22:38 +00:00
tail: print bytes as char instead of u8
This commit is contained in:
parent
88f4db4db6
commit
e149be492d
1 changed files with 2 additions and 2 deletions
|
@ -234,7 +234,7 @@ fn tail_lines<T: Reader>(reader: &mut BufferedReader<T>, mut line_count: uint, b
|
|||
|
||||
#[inline]
|
||||
fn tail_bytes<T: Reader>(reader: &mut BufferedReader<T>, mut byte_count: uint, beginning: bool) {
|
||||
let mut ringbuf: RingBuf<u8> = RingBuf::new();
|
||||
let mut ringbuf: RingBuf<char> = RingBuf::new();
|
||||
let mut bytes = reader.bytes().skip(
|
||||
if beginning {
|
||||
let temp = byte_count;
|
||||
|
@ -250,7 +250,7 @@ fn tail_bytes<T: Reader>(reader: &mut BufferedReader<T>, mut byte_count: uint, b
|
|||
if byte_count <= ringbuf.len() {
|
||||
ringbuf.pop_front();
|
||||
}
|
||||
ringbuf.push_back(byte);
|
||||
ringbuf.push_back(byte as char);
|
||||
}
|
||||
Err(err) => panic!(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue