Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler error of the cli example #17

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/cli.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use core::num::NonZeroU16;
/// A cli tool to connect to a device that talks the protocol.
use failure::{err_msg, format_err, Error};
use panel_protocol::{
ArrayVec, Command, PulseMode, Report, ReportReader, MAX_REPORT_LEN, MAX_REPORT_QUEUE_LEN,
};
use panel_protocol::{ArrayVec, Command, PulseMode, Report, ReportReader, MAX_REPORT_LEN};
use serial_core::{BaudRate, SerialDevice, SerialPortSettings};
use serial_unix::TTYPort;
use std::{
Expand Down Expand Up @@ -43,7 +41,7 @@ impl Panel {
Ok(Self { tty, protocol, read_buf })
}

fn poll(&mut self) -> Result<ArrayVec<[Report; MAX_REPORT_QUEUE_LEN]>, Error> {
fn poll(&mut self) -> Result<ArrayVec<Report, MAX_REPORT_LEN>, Error> {
match self.tty.read(&mut self.read_buf) {
Ok(0) => Err(err_msg("End of file reached")),
Ok(count) => self
Expand Down
Loading