diff --git a/firmware/src/command_parser.rs b/firmware/src/command_parser.rs index 36be426..db8b397 100644 --- a/firmware/src/command_parser.rs +++ b/firmware/src/command_parser.rs @@ -1,4 +1,4 @@ -use logos::{Logos, Lexer}; +use logos::Logos; use super::session::ReportMode; #[derive(Logos, Debug, PartialEq)] @@ -37,14 +37,14 @@ pub enum Error { } #[derive(Debug)] -pub enum CommandShow { +pub enum ShowCommand { ReportMode, } #[derive(Debug)] pub enum Command { Quit, - Show(CommandShow), + Show(ShowCommand), Report(ReportMode), } @@ -73,7 +73,7 @@ impl Command { Quit => Ok(Command::Quit), Report => choice![ Mode => choice![ - End => Ok(Command::Show(CommandShow::ReportMode)), + End => Ok(Command::Show(ShowCommand::ReportMode)), Off => Ok(Command::Report(ReportMode::Off)), Once => Ok(Command::Report(ReportMode::Once)), Continuous => Ok(Command::Report(ReportMode::Continuous)), diff --git a/firmware/src/main.rs b/firmware/src/main.rs index 5fd4ffd..a1cae4c 100644 --- a/firmware/src/main.rs +++ b/firmware/src/main.rs @@ -35,7 +35,7 @@ mod board; use self::board::{gpio::Gpio, systick::get_time}; mod ethmac; mod command_parser; -use command_parser::{Command, CommandShow}; +use command_parser::{Command, ShowCommand}; mod session; use self::session::{Session, SessionOutput}; mod ad7172; @@ -227,7 +227,7 @@ fn main() -> ! { Ok(SessionOutput::Command(Command::Report(mode))) => { let _ = writeln!(socket, "Report mode: {:?}", mode); } - Ok(SessionOutput::Command(Command::Show(CommandShow::ReportMode))) => { + Ok(SessionOutput::Command(Command::Show(ShowCommand::ReportMode))) => { let _ = writeln!(socket, "Report mode: {:?}", session.report_mode()); } Ok(SessionOutput::Command(command)) => { diff --git a/firmware/src/session.rs b/firmware/src/session.rs index 0f18e0b..a1a8e04 100644 --- a/firmware/src/session.rs +++ b/firmware/src/session.rs @@ -17,7 +17,7 @@ impl LineReader { } pub fn feed(&mut self, c: u8) -> Option<&str> { - if (c == 13 || c == 10) { + if c == 13 || c == 10 { // Enter if self.pos > 0 { let len = self.pos;