X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=sndplay%2Fsrc%2Fcommand.rs;h=3aac7cb99d1f7509f91ec2b1f1ad7b1de6697bb6;hb=c84ea16daef963fe73d4b2e69b20b68524563ae0;hp=b706b9a2f05f9ec9787b6f8e97de1b0a37a24fd7;hpb=3f9b450c63b8876a2925268f08ad34c97a0bc16d;p=nihav-player.git diff --git a/sndplay/src/command.rs b/sndplay/src/command.rs index b706b9a..3aac7cb 100644 --- a/sndplay/src/command.rs +++ b/sndplay/src/command.rs @@ -26,7 +26,7 @@ pub struct CmdLineState { } impl CmdLineState { pub fn new() -> Self { - let mut orig_state: termios = unsafe { std::mem::MaybeUninit::uninit().assume_init() }; + let mut orig_state: termios = unsafe { let tmp = std::mem::MaybeUninit::uninit(); tmp.assume_init() }; unsafe { tcgetattr(0, &mut orig_state); } let mut new_state = orig_state; new_state.c_lflag &= !(libc::ECHO | libc::ICANON); @@ -34,7 +34,7 @@ impl CmdLineState { Self { orig_state } } pub fn new_normal() -> Self { - let mut orig_state: termios = unsafe { std::mem::MaybeUninit::uninit().assume_init() }; + let mut orig_state: termios = unsafe { let tmp = std::mem::MaybeUninit::uninit(); tmp.assume_init() }; unsafe { tcgetattr(0, &mut orig_state); } let mut new_state = orig_state; new_state.c_lflag |= libc::ECHO | libc::ICANON;