command_parser: s/CommandShow/ShowCommand/, delint

This commit is contained in:
Astro 2019-09-11 00:23:15 +02:00
parent 0dcd35c9f2
commit 44f5a8338c
3 changed files with 7 additions and 7 deletions

View File

@ -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)),

View File

@ -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)) => {

View File

@ -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;