File tree 1 file changed +11
-0
lines changed
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 {
188
188
Ok ( buf. len ( ) )
189
189
}
190
190
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
+
191
198
fn read_buf ( & mut self , mut buf : BorrowedCursor < ' _ > ) -> io:: Result < ( ) > {
192
199
// SAFETY: No uninit bytes are being written
193
200
for slot in unsafe { buf. as_mut ( ) } {
@@ -204,6 +211,10 @@ impl Read for Repeat {
204
211
Ok ( ( ) )
205
212
}
206
213
214
+ fn read_buf_exact ( & mut self , buf : BorrowedCursor < ' _ > ) -> io:: Result < ( ) > {
215
+ self . read_buf ( buf)
216
+ }
217
+
207
218
/// This function is not supported by `io::Repeat`, because there's no end of its data
208
219
fn read_to_end ( & mut self , _: & mut Vec < u8 > ) -> io:: Result < usize > {
209
220
Err ( io:: Error :: from ( io:: ErrorKind :: OutOfMemory ) )
You can’t perform that action at this time.
0 commit comments