summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-08-30 08:41:20 (GMT)
committerSebastian Dröge <sebastian@centricular.com>2016-08-30 08:41:20 (GMT)
commitf2c10af927eb17027781f4e37f073e0bb1e8156f (patch)
tree48e6fb68b86f3eb16be7fbc5a8e759ada674d09f /src/main.rs
parent7e263aba7d9fc13b4bddd9aa7e75bd66b376d80a (diff)
downloadptp-clock-reflector-f2c10af927eb17027781f4e37f073e0bb1e8156f.zip
ptp-clock-reflector-f2c10af927eb17027781f4e37f073e0bb1e8156f.tar.gz
Fix clippy warnings
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs17
1 files 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);
}
}
}