diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-04-20 19:54:46 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-04-20 19:54:46 -0700 |
| commit | 8055bb87c5d17f4e108097f24171cb8baab71072 (patch) | |
| tree | e855de473ceb4bf61316f7cca469348d69f0f6b0 /library/std/src/sys | |
| parent | d19b64fb54391b64ce99981577c67c93ac2a9ffa (diff) | |
| download | rust-8055bb87c5d17f4e108097f24171cb8baab71072.tar.gz rust-8055bb87c5d17f4e108097f24171cb8baab71072.zip | |
More `mem::take` in `library`
A bunch of places were using `replace(…, &mut [])`, but that can just be `take`.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/unsupported/io.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/unsupported/io.rs b/library/std/src/sys/unsupported/io.rs index 82610ffab7e..6372fca74e0 100644 --- a/library/std/src/sys/unsupported/io.rs +++ b/library/std/src/sys/unsupported/io.rs @@ -30,7 +30,7 @@ impl<'a> IoSliceMut<'a> { #[inline] pub fn advance(&mut self, n: usize) { - let slice = mem::replace(&mut self.0, &mut []); + let slice = mem::take(&mut self.0); let (_, remaining) = slice.split_at_mut(n); self.0 = remaining; } |
