Skip to content

Commit

Permalink
Remove compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bofh69 committed Oct 9, 2019
1 parent b80bd96 commit a146050
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl Tracer for FileTracer {

impl FileTracer {
fn new(path: &std::path::PathBuf) -> Self {
FileTracer {
Self {
file: std::fs::File::create(path).unwrap(),
}
}
Expand All @@ -138,11 +138,11 @@ impl std::str::FromStr for Unit {

pub struct Otii {
port: std::io::BufReader<serial::SystemPort>,
tracer: Box<Tracer>,
tracer: Box<dyn Tracer>,
}

impl Otii {
pub fn new(dev: &std::path::PathBuf, tracer: Box<Tracer>) -> Otii {
pub fn new(dev: &std::path::PathBuf, tracer: Box<dyn Tracer>) -> Otii {
use serial::SerialPort;
let mut port = std::io::BufReader::new(serial::open(dev).unwrap());
port.get_mut().configure(&SERIAL_SETTINGS).unwrap();
Expand Down Expand Up @@ -274,9 +274,7 @@ impl Otii {
let mut total_value = 0.0;
let mut nr_values = 0;
let pb = indicatif::ProgressBar::new(u64::from(max_samples));
pb.set_style(
indicatif::ProgressStyle::default_bar().progress_chars("█▉▊▋▌▍▎▏ "),
);
pb.set_style(indicatif::ProgressStyle::default_bar().progress_chars("█▉▊▋▌▍▎▏ "));
loop {
if let Some(line) = self.read_line() {
let mut data = line.trim().split(':');
Expand Down

0 comments on commit a146050

Please sign in to comment.