From eddd29f9abaa2198f994acb1c70a861973c346ff Mon Sep 17 00:00:00 2001 From: Youseok Yang Date: Tue, 10 Sep 2024 10:17:15 +0900 Subject: [PATCH] Change write_slice() to copy_from_slice() To follow API update[1], change MaybeUninit::write_slice() to copy_from_slice(). [1]: https://github.com/rust-lang/rust/pull/116385 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 09028e3..07fac8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -532,7 +532,7 @@ impl OwnedCursor { // SAFETY: we do not de-initialize any of the elements of the slice unsafe { - MaybeUninit::write_slice(&mut self.as_mut()[..data.len()], data); + MaybeUninit::copy_from_slice(&mut self.as_mut()[..data.len()], data); } // SAFETY: We just added the entire contents of data.