vmm: Use assert!() rather than if+panic

As identified by the new beta clippy.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-10-19 15:01:42 +01:00
parent 48d4ccbfeb
commit e9ea9d63f8

View File

@ -94,9 +94,11 @@ fn sigwinch_listener_main(seccomp_filter: BpfProgram, tx: File, tty: &File) -> !
while unsafe { poll(&mut pollfd, 1, -1) } == -1 { while unsafe { poll(&mut pollfd, 1, -1) } == -1 {
let e = io::Error::last_os_error(); let e = io::Error::last_os_error();
if !matches!(e.kind(), ErrorKind::Interrupted | ErrorKind::WouldBlock) { assert!(
panic!("poll: {}", e); matches!(e.kind(), ErrorKind::Interrupted | ErrorKind::WouldBlock),
} "poll: {}",
e
);
} }
assert_eq!(pollfd.revents, POLLERR); assert_eq!(pollfd.revents, POLLERR);