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:
parent
4ea5190026
commit
dca90f7ec1
1 changed files with 1 additions and 2 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue