abonander / buf_redux

A drop-in replacement for Rust's std::io::BufReader, with extra features
Apache License 2.0
38 stars 16 forks source link

Return an error if buffer is full #2

Closed troplin closed 7 years ago

troplin commented 8 years ago

read_into_buf should return an error if the buffer is full and no additional bytes are read.

abonander commented 7 years ago

I don't think this would help anyone. The buffer will return Ok(0) if the buffer is full, as this is the expected behavior of Read::read() when given a zero-length slice (though I have an early return in Buffer::read_from() because hyper::server::Request doesn't like zero-sized reads).