chore: remove benches and fix/work around clippy lints (#1952)

This commit is contained in:
Artem Vorotnikov
2019-12-13 22:01:47 -08:00
committed by Carl Lerche
parent 91ecb4b4c2
commit d593c5b051
34 changed files with 89 additions and 1041 deletions
+4 -5
View File
@@ -36,10 +36,9 @@ async fn main() -> Result<(), Box<dyn Error>> {
};
// Parse what address we're going to connect to
let addr = match args.first() {
Some(addr) => addr,
None => Err("this program requires at least one argument")?,
};
let addr = args
.first()
.ok_or("this program requires at least one argument")?;
let addr = addr.parse::<SocketAddr>()?;
let stdin = FramedRead::new(io::stdin(), codec::Bytes);
@@ -163,7 +162,7 @@ mod codec {
type Error = io::Error;
fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<Vec<u8>>> {
if buf.len() > 0 {
if !buf.is_empty() {
let len = buf.len();
Ok(Some(buf.split_to(len).into_iter().collect()))
} else {