File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,13 @@ impl Read for Repeat {
188188 Ok ( buf. len ( ) )
189189 }
190190
191+ fn read_exact ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < ( ) > {
192+ for slot in & mut * buf {
193+ * slot = self . byte ;
194+ }
195+ Ok ( ( ) )
196+ }
197+
191198 fn read_buf ( & mut self , mut buf : BorrowedCursor < ' _ > ) -> io:: Result < ( ) > {
192199 // SAFETY: No uninit bytes are being written
193200 for slot in unsafe { buf. as_mut ( ) } {
@@ -204,6 +211,10 @@ impl Read for Repeat {
204211 Ok ( ( ) )
205212 }
206213
214+ fn read_buf_exact ( & mut self , buf : BorrowedCursor < ' _ > ) -> io:: Result < ( ) > {
215+ self . read_buf ( buf)
216+ }
217+
207218 /// This function is not supported by `io::Repeat`, because there's no end of its data
208219 fn read_to_end ( & mut self , _: & mut Vec < u8 > ) -> io:: Result < usize > {
209220 Err ( io:: Error :: from ( io:: ErrorKind :: OutOfMemory ) )
You can’t perform that action at this time.
0 commit comments