diff options
author | Neal H. Walfield <neal@pep.foundation> | 2018-11-16 11:33:34 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2018-11-16 11:40:19 +0100 |
commit | 01bba7503c55121a73d7f95de2122101f6d1f067 (patch) | |
tree | 5494c75618a2beef81cb5677c5df9b493738e5a1 /buffered-reader/src/memory.rs | |
parent | ca44e50faa3741fd3d70bcab6a8ffa570ff5e151 (diff) |
buffered-reader: Require that BufferedReaders implement Display.
- Also, update BufferedReaders to implement it.
Diffstat (limited to 'buffered-reader/src/memory.rs')
-rw-r--r-- | buffered-reader/src/memory.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/buffered-reader/src/memory.rs b/buffered-reader/src/memory.rs index a7e8c1de..fc94f8fb 100644 --- a/buffered-reader/src/memory.rs +++ b/buffered-reader/src/memory.rs @@ -20,6 +20,13 @@ pub struct BufferedReaderMemory<'a, C> { cookie: C, } +impl<'a, C> fmt::Display for BufferedReaderMemory<'a, C> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "BufferedReaderMemory ({} of {} bytes read)", + self.cursor, self.buffer.len()) + } +} + impl<'a, C> fmt::Debug for BufferedReaderMemory<'a, C> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("BufferedReaderMemory") |