From f2c10af927eb17027781f4e37f073e0bb1e8156f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 30 Aug 2016 11:41:20 +0300 Subject: Fix clippy warnings --- src/main.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 22a49bc..5e3ef10 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,17 +105,17 @@ impl Handler for PtpReflectorHandler { let length = match socket.recv_from(msg) { Err(e) => { - print!("Error while receiving message: {}\n", e.to_string()); + println!("Error while receiving message: {}", e.to_string()); return; } Ok(Some((l, _))) => l, Ok(None) => { - print!("Error while receiving message\n"); + println!("Error while receiving message"); return; } }; - print!("Got message of size {}\n", length); + println!("Got message of size {}", length); if length < 44 { return; @@ -152,15 +152,12 @@ impl Handler for PtpReflectorHandler { }; if forward { - match socket.send_to(&msg[..length], addr) { - Err(e) => { - print!("Error while sending message: {}\n", e.to_string()); - return; - } - _ => (), + if let Err(e) = socket.send_to(&msg[..length], addr) { + println!("Error while sending message: {}", e.to_string()); + return; }; - print!("Sent message of size {}\n", length); + println!("Sent message of size {}", length); } } } -- cgit v0.11.2-2-gd1dd