Iterating while ($reader->isEndOfFile()) has several edge cases:
file already closed (especially STDIN)
foo\nbar should be vec["foo", "bar"], not "foo" followed by
EPIPE
readUntil still does exactly what it says on the tin.
The new behavior matches both C Rust IO. It's different from python,
which addresses this by including the "\n".
Going for this approach instead of the python approach as I expect
most users to just Str\strip_suffix()-away the trailing \n and not
handle the empty string.
Also:
Iterating
while ($reader->isEndOfFile())
has several edge cases:foo\nbar
should bevec["foo", "bar"]
, not"foo"
followed byEPIPE
readUntil still does exactly what it says on the tin.
The new behavior matches both C Rust IO. It's different from python, which addresses this by including the "\n".
Going for this approach instead of the python approach as I expect most users to just
Str\strip_suffix()
-away the trailing\n
and not handle the empty string.Providing a higher-level API seems to be safer.