From 9f5b76253c8b63bc2a1b9af8589e5f54acc49498 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 15 May 2018 15:01:30 +0000 Subject: [PATCH] firmware: remove some unnecessary unwraps. --- artiq/firmware/runtime/moninj.rs | 5 +++-- artiq/firmware/runtime/rtio_dma.rs | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/artiq/firmware/runtime/moninj.rs b/artiq/firmware/runtime/moninj.rs index 67b582ba2..d589d63d2 100644 --- a/artiq/firmware/runtime/moninj.rs +++ b/artiq/firmware/runtime/moninj.rs @@ -1,5 +1,6 @@ use alloc::btree_map::BTreeMap; +use io::Error as IoError; use moninj_proto::*; use sched::{Io, TcpListener, TcpStream, Error as SchedError}; use board_misoc::{clock, csr}; @@ -184,7 +185,7 @@ fn connection_worker(io: &Io, mut stream: &mut TcpStream) -> Result<(), Error next_check { for (&(channel, probe), previous) in watch_list.iter_mut() { let current = read_probe(channel, probe); - if previous.is_none() || (previous.unwrap() != current) { + if previous.is_none() || previous.unwrap() != current { let message = DeviceMessage::MonitorStatus { channel: channel, probe: probe, @@ -200,7 +201,7 @@ fn connection_worker(io: &Io, mut stream: &mut TcpStream) -> Result<(), Error