about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2023-10-07 01:13:55 -0400
committerWilfred Hughes <me@wilfred.me.uk>2023-10-07 01:16:45 -0400
commitdca90f7ec1a15fb47fbaba5bcde5073c699a8388 (patch)
treeea016bcd108e1d22db2ee4e92d717054ee6b83b4 /library/std/src
parent4ea5190026dbc1302b644d938e68bc6843cb8b24 (diff)
downloadrust-dca90f7ec1a15fb47fbaba5bcde5073c699a8388.tar.gz
rust-dca90f7ec1a15fb47fbaba5bcde5073c699a8388.zip
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.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/io/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs
index c93bf020252..e6431abcf82 100644
--- a/library/std/src/io/mod.rs
+++ b/library/std/src/io/mod.rs
@@ -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),