| Age | Commit message (Collapse) | Author | Lines |
|
|
|
These methods are sorely needed on readers and writers, and I believe that the
encoding story should be solved with composition. This commit adds back the
missed functions when reading/writing strings onto generic Readers/Writers.
|
|
raw}::copy_memory.
Slices carry their length with them, so we can just use that
information.
|
|
Also remove all instances of 'self within the codebase.
This fixes #10889.
|
|
This allows one to reduce the number of reallocs of the internal buffer
if one has an approximate idea of the size of the final output.
|
|
compile-fail tests, run-fail tests, and run-pass tests.
|
|
|
|
These commits create a `Buffer` trait in the `io` module which represents an I/O reader which is internally buffered. This abstraction is used to reasonably implement `read_line` and `read_until` along with at least an ok implementation of `read_char` (although I certainly haven't benchmarked `read_char`).
|
|
|
|
This trait is meant to abstract whether a reader is actually implemented with an
underlying buffer. For all readers which are implemented as such, we can
efficiently implement things like read_char, read_line, read_until, etc. There
are two required methods for managing the internal buffer, and otherwise
read_line and friends can all become default methods.
Closes #10334
|
|
Filled in the implementations of Writer and Seek for BufWriter. It
raises the io_error condition if a write cannot fit in the buffer.
The Seek implementation for MemWriter, which was incorrectly using
unsigned arithmatic to add signed offsets, has also been replaced.
|
|
|