Rollup merge of #120523 - a1phyr:improve_read_buf_exact, r=the8472
Improve `io::Read::read_buf_exact` error case - Use `const_io_error` instead of `Error::new` - Use the same message as `read_exact`
This commit is contained in:
commit
a3ea64719b
@ -994,7 +994,10 @@ fn read_buf_exact(&mut self, mut cursor: BorrowedCursor<'_>) -> Result<()> {
|
||||
}
|
||||
|
||||
if cursor.written() == prev_written {
|
||||
return Err(Error::new(ErrorKind::UnexpectedEof, "failed to fill buffer"));
|
||||
return Err(error::const_io_error!(
|
||||
ErrorKind::UnexpectedEof,
|
||||
"failed to fill whole buffer"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user