From 8055bb87c5d17f4e108097f24171cb8baab71072 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Thu, 20 Apr 2023 19:54:46 -0700 Subject: More `mem::take` in `library` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A bunch of places were using `replace(…, &mut [])`, but that can just be `take`. --- library/std/src/sys/unsupported/io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'library/std/src/sys') 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; } -- cgit 1.4.1-3-g733a5