Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: change pinger to work in "better" manner #273

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
clippy windows
  • Loading branch information
nitay committed Mar 12, 2023
commit 792bc1aa010e07cdcbfb27a65675c264df232138
2 changes: 1 addition & 1 deletion pinger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub fn ping_with_interval(
let mut p = windows::WindowsPinger::default();
p.set_interval(interval);
p.set_interface(interface);
return p.start::<windows::WindowsParser>(addr);
p.start::<windows::WindowsParser>(addr);
}
#[cfg(unix)]
{
Expand Down
2 changes: 1 addition & 1 deletion pinger/src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ impl Parser for LinuxParser {
return self.extract_regex(&UBUNTU_RE, line.to_string());
}
}
return Some(PingResult::Failed("1".to_string(), format!("Failed to parse: {}", lines)));
return Some(PingResult::Failed("1".to_string(), format!("Failed to parse: {lines}")));
}
}
2 changes: 1 addition & 1 deletion pinger/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Pinger for WindowsPinger {
let pinger = WinPinger::new();
loop {
let buffer = Buffer::new();
match pinger.send(parsed_ip.clone(), buffer).await.result {
match pinger.send(parsed_ip, buffer).await.result {
Ok(rtt) => {
if tx
.send(PingResult::Pong(
Expand Down