From 0f93ff9dc24d610fc3b80a63b5d9399a06f225b1 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Sun, 20 Sep 2020 23:56:04 -0500 Subject: [PATCH] remove some warnings --- src/main.rs | 3 +-- src/pipe.rs | 4 ---- src/ser.rs | 1 - src/xb.rs | 5 +---- src/xbrx.rs | 9 +-------- 5 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/main.rs b/src/main.rs index 74d6864..563c45e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,6 @@ mod ping; use std::path::PathBuf; use structopt::StructOpt; -use std::convert::TryInto; #[derive(Debug, StructOpt)] #[structopt(name = "xbnet", about = "Networking for XBee Radios", author = "John Goerzen ")] @@ -98,7 +97,7 @@ fn main() { thread::spawn(move || pipe::stdout_processor(&mut xbreframer, &mut xb.ser_reader).expect("Failure in stdout_processor")); pipe::stdin_processor(dest_u64, 1600, xbeesender).expect("Failure in stdin_processor"); // Make sure queued up data is sent - writerthread.join(); + let _ = writerthread.join(); }, } diff --git a/src/pipe.rs b/src/pipe.rs index aca90d9..ab25532 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -22,12 +22,8 @@ use crate::xbpacket::*; use crate::ser::*; use crate::xbrx::*; use crossbeam_channel; -use std::thread; -use std::time::Duration; use bytes::*; -const INTERVAL: u64 = 5; - pub fn stdin_processor(dest: u64, maxframesize: usize, sender: crossbeam_channel::Sender) -> io::Result<()> { let stdin = io::stdin(); diff --git a/src/ser.rs b/src/ser.rs index ac60303..d9050c0 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -20,7 +20,6 @@ use std::io; use serialport::prelude::*; use std::io::{BufReader, BufRead, Write}; use log::*; -use std::sync::{Arc, Mutex}; use std::time::Duration; use std::path::PathBuf; use bytes::*; diff --git a/src/xb.rs b/src/xb.rs index 66c481a..f36b34f 100644 --- a/src/xb.rs +++ b/src/xb.rs @@ -24,13 +24,10 @@ use std::io; use crossbeam_channel; use hex; use std::thread; -use std::time::{Duration, Instant}; -use format_escape_default::format_escape_default; +use std::time::{Duration}; use std::path::PathBuf; use bytes::Bytes; -use std::convert::TryInto; use crate::xbpacket::*; -use serialport::prelude::*; pub fn mkerror(msg: &str) -> Error { Error::new(ErrorKind::Other, msg) diff --git a/src/xbrx.rs b/src/xbrx.rs index 3dd8fba..28aeab9 100644 --- a/src/xbrx.rs +++ b/src/xbrx.rs @@ -21,15 +21,8 @@ use crate::ser::*; use crate::xbpacket::*; use log::*; -use std::fs; -use std::io::{BufRead, BufReader, Error, ErrorKind, Read}; -use std::io; -use crossbeam_channel; +use std::io::{Read}; use hex; -use std::thread; -use std::time::{Duration, Instant}; -use format_escape_default::format_escape_default; -use std::path::PathBuf; use bytes::*; use std::collections::HashMap;