diff --git a/hostcontrol/src/main.rs b/hostcontrol/src/main.rs index a3f97a8..4b1eb15 100644 --- a/hostcontrol/src/main.rs +++ b/hostcontrol/src/main.rs @@ -54,14 +54,9 @@ fn main() { sleep(Duration::from_secs(5)); } +#[derive(Default)] struct App {} -impl Default for App { - fn default() -> Self { - App {} - } -} - impl eframe::App for App { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { egui::CentralPanel::default().show(ctx, |ui| { diff --git a/hostcontrol/src/stage_io.rs b/hostcontrol/src/stage_io.rs index d0cec47..1ffca22 100644 --- a/hostcontrol/src/stage_io.rs +++ b/hostcontrol/src/stage_io.rs @@ -35,7 +35,7 @@ impl StageIO { let mut buf = [0u8; 1]; self.serial .read_exact(&mut buf) - .map_err(|e| StageIOError::Read(e))?; + .map_err(StageIOError::Read)?; res.push(buf[0]); if res.ends_with(needle.as_ref().as_bytes()) { return Ok(String::from_utf8_lossy(&res).to_string()); @@ -48,7 +48,7 @@ impl StageIO { debug!("->: {:?}", command.as_ref()); self.serial .write_all(command.as_ref().as_bytes()) - .map_err(|e| StageIOError::Write(e))?; + .map_err(StageIOError::Write)?; let response = self.receive_until("\n")?; debug!("<-: {:?}", response); Ok(response.trim().to_string())