]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/io/buffered/bufreader.rs
Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514
[rust.git] / library / std / src / io / buffered / bufreader.rs
index 88ad92d8a985971134ba3171a952547fa6003e9e..4f339a18a480ec8ef42187b347b9dc0ce2bfbd1e 100644 (file)
@@ -224,6 +224,14 @@ fn discard_buffer(&mut self) {
     }
 }
 
+// This is only used by a test which asserts that the initialization-tracking is correct.
+#[cfg(test)]
+impl<R> BufReader<R> {
+    pub fn initialized(&self) -> usize {
+        self.buf.initialized()
+    }
+}
+
 impl<R: Seek> BufReader<R> {
     /// Seeks relative to the current position. If the new position lies within the buffer,
     /// the buffer will not be flushed, allowing for more efficient seeks.