diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index c93bf0202523a..e6431abcf8215 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(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),