Closed
Description
Update: this is the tracking issue for:
impl<R: Read> BufReader<R> {
pub fn buffer(&self) -> &[u8] {…}
#[rustc_deprecated(since = "1.26.0", reason = "use .buffer().is_empty() instead")]
pub fn is_empty(&self) -> bool {…}
}
is_empty
is both unstable and deprecated, it should be removed.
There is currently no way to tell whether there is any data buffered inside a BufReader. This is unfortunate because it means that an application has no way to know whether calls to read() and fill_buffer() will return instantly or trigger a potentially expensive call to the underlying Reader. I propose adding an is_empty() method to BufReader to fill this gap.