Remove unnecessary tmp variable in default_read_exact

This variable seems to serve no purpose, and it's a little confusing
when reading std source code, so remove it.
This commit is contained in:
Wilfred Hughes 2023-10-07 01:13:55 -04:00
parent 4ea5190026
commit dca90f7ec1

View File

@ -513,8 +513,7 @@ pub(crate) fn default_read_exact<R: Read + ?Sized>(this: &mut R, mut buf: &mut [
match this.read(buf) {
Ok(0) => break,
Ok(n) => {
let tmp = buf;
buf = &mut tmp[n..];
buf = &mut buf[n..];
}
Err(ref e) if e.is_interrupted() => {}
Err(e) => return Err(e),