Skip to content

Commit

Permalink
tail: Refactor chunks.rs and small parts of tail.rs. Replace unwraps …
Browse files Browse the repository at this point in the history
…with error propagation ...

Return io::Result from methods in chunks.rs to be able to replace unwraps with error propagation and
return the bytes read from the source so far. Store how many bytes are read in LinesChunkBuffer.

Fixes: tail does not output anything when there's no newline in the source and the `--follow` option
is given. Flush the buffered writer after a write explicitly.

Simplify the BytesChunkBuffer::fill and LinesChunkBuffer::fill methods and make use of some new
helper methods in these structs.

Add more unit tests for structs in chunks.rs
  • Loading branch information
Joining7943 committed Apr 9, 2023
1 parent b7588be commit 3c9171f
Show file tree
Hide file tree
Showing 3 changed files with 575 additions and 128 deletions.
Loading

0 comments on commit 3c9171f

Please sign in to comment.