diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2023-10-07 01:13:55 -0400 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2023-10-07 01:16:45 -0400 |
| commit | dca90f7ec1a15fb47fbaba5bcde5073c699a8388 (patch) | |
| tree | ea016bcd108e1d22db2ee4e92d717054ee6b83b4 /library/std/src | |
| parent | 4ea5190026dbc1302b644d938e68bc6843cb8b24 (diff) | |
| download | rust-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.rs | 3 |
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), |
