Some clippy improvements
This commit is contained in:
parent
35d5d7f750
commit
c20094fb3f
@ -14,7 +14,7 @@ struct Args {
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args = Args::parse();
|
||||
let write_all = args.matches.len() == 0;
|
||||
let write_all = args.matches.is_empty();
|
||||
let mut smgr = StreamMgr::new();
|
||||
|
||||
// Obtain list of devices
|
||||
@ -27,15 +27,15 @@ fn main() -> Result<()> {
|
||||
|
||||
// If no device name strings are given, we are outputting them all to a file.
|
||||
if write_all {
|
||||
let daqconfig = DaqConfig::newFromDeviceInfo(&dev);
|
||||
let daqconfig = DaqConfig::newFromDeviceInfo(dev);
|
||||
daqconfig.serialize_TOML_file(&filename.clone().into())?;
|
||||
} else {
|
||||
// See if we find the name in the match list.
|
||||
for m in args.matches.iter() {
|
||||
let needle = m.to_lowercase();
|
||||
let dev_lower = (&dev.device_name).to_lowercase();
|
||||
let dev_lower = dev.device_name.to_lowercase();
|
||||
if dev_lower.contains(&needle) {
|
||||
DaqConfig::newFromDeviceInfo(&dev)
|
||||
DaqConfig::newFromDeviceInfo(dev)
|
||||
.serialize_TOML_file(&filename.clone().into())?;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use crossbeam::channel::{unbounded, Receiver, TryRecvError};
|
||||
use lasprs::daq::{InStreamMsg, StreamHandler, StreamMgr, StreamStatus, StreamType};
|
||||
use lasprs::daq::{StreamMgr, StreamStatus, StreamType};
|
||||
use lasprs::siggen::Siggen;
|
||||
use std::io;
|
||||
use std::{thread, time};
|
||||
@ -11,7 +11,7 @@ fn spawn_stdin_channel() -> Receiver<String> {
|
||||
thread::spawn(move || 'tt: loop {
|
||||
let mut buffer = String::new();
|
||||
io::stdin().read_line(&mut buffer).unwrap();
|
||||
if let Err(_) = tx.send(buffer) {
|
||||
if tx.send(buffer).is_err() {
|
||||
break 'tt;
|
||||
}
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Provides stream messages that come from a running stream
|
||||
use crate::config::*;
|
||||
use crate::daq::Qty;
|
||||
use crate::siggen::Siggen;
|
||||
use crate::siggen::{Siggen, Source};
|
||||
use anyhow::{bail, Result};
|
||||
use crossbeam::channel::Sender;
|
||||
use std::any::TypeId;
|
||||
|
Loading…
Reference in New Issue
Block a user