}
impl CmdLineState {
pub fn new() -> Self {
- let mut orig_state: termios = unsafe { std::mem::uninitialized() };
+ let mut orig_state: termios = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
unsafe { tcgetattr(0, &mut orig_state); }
let mut new_state = orig_state;
new_state.c_lflag &= !(libc::ECHO | libc::ICANON);
Self { orig_state }
}
pub fn new_normal() -> Self {
- let mut orig_state: termios = unsafe { std::mem::uninitialized() };
+ let mut orig_state: termios = unsafe { std::mem::MaybeUninit::uninit().assume_init() };
unsafe { tcgetattr(0, &mut orig_state); }
let mut new_state = orig_state;
new_state.c_lflag |= libc::ECHO | libc::ICANON;