mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
Merge pull request #458 from dokaptur/tail
tail: print bytes as char instead of u8
This commit is contained in:
commit
7768440348
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…
Add table
Add a link
Reference in a new issue