Skip to content

Commit 6114ce6

Browse files
committed
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.
1 parent 621aec0 commit 6114ce6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

std/src/io/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,7 @@ pub(crate) fn default_read_exact<R: Read + ?Sized>(this: &mut R, mut buf: &mut [
513513
match this.read(buf) {
514514
Ok(0) => break,
515515
Ok(n) => {
516-
let tmp = buf;
517-
buf = &mut tmp[n..];
516+
buf = &mut buf[n..];
518517
}
519518
Err(ref e) if e.is_interrupted() => {}
520519
Err(e) => return Err(e),

0 commit comments

Comments
 (0)