diff options
author | Matthias Krüger <matthias.krueger@famsik.de> | 2019-09-10 18:08:01 +0200 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-09-10 16:08:01 +0000 |
commit | 1067fa609b6a5a0017814cb96d8b21b39b2f83f2 (patch) | |
tree | 4b71a2863f0efdbc5aeb3a8f36234f85e59f7eec /alacritty_terminal/src/term/cell.rs | |
parent | 8aa406b98b3932a47a05ac8d71b4704198acd6f2 (diff) | |
download | alacritty-1067fa609b6a5a0017814cb96d8b21b39b2f83f2.tar.gz alacritty-1067fa609b6a5a0017814cb96d8b21b39b2f83f2.zip |
Replace uninitialized with MaybeUninit
Diffstat (limited to 'alacritty_terminal/src/term/cell.rs')
-rw-r--r-- | alacritty_terminal/src/term/cell.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index 5e2762d2..8d1b135c 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -138,14 +138,14 @@ impl Cell { #[inline] pub fn chars(&self) -> [char; MAX_ZEROWIDTH_CHARS + 1] { unsafe { - let mut chars = [std::mem::uninitialized(); MAX_ZEROWIDTH_CHARS + 1]; - std::ptr::write(&mut chars[0], self.c); + let mut chars = [std::mem::MaybeUninit::uninit(); MAX_ZEROWIDTH_CHARS + 1]; + std::ptr::write(chars[0].as_mut_ptr(), self.c); std::ptr::copy_nonoverlapping( - self.extra.as_ptr(), + self.extra.as_ptr() as *mut std::mem::MaybeUninit<char>, chars.as_mut_ptr().offset(1), self.extra.len(), ); - chars + std::mem::transmute(chars) } } |