mirror of
https://github.com/imsnif/bandwhich.git
synced 2026-02-09 01:59:18 +08:00
Merge pull request #468 from imsnif/clippy-fixes
Apply new clippy lints
This commit is contained in:
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
* Update CONTRIBUTING information #438 - @YJDoc2 @cyqsimon
|
||||
* Fix new clippy lint #457 - @cyqsimon
|
||||
* Apply new clippy lints #468 - @cyqsimon
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ impl Sniffer {
|
||||
}
|
||||
pub fn reset_channel(&mut self) -> Result<()> {
|
||||
self.network_frames = get_datalink_channel(&self.network_interface)
|
||||
.map_err(|_| io::Error::new(io::ErrorKind::Other, "Interface not available"))?;
|
||||
.map_err(|_| io::Error::other("Interface not available"))?;
|
||||
Ok(())
|
||||
}
|
||||
fn handle_v6(ip_packet: Ipv6Packet, network_interface: &NetworkInterface) -> Option<Segment> {
|
||||
|
||||
@@ -80,7 +80,7 @@ fn get_interface(interface_name: &str) -> Option<NetworkInterface> {
|
||||
fn create_write_to_stdout() -> Box<dyn FnMut(&str) + Send> {
|
||||
let mut stdout = io::stdout();
|
||||
Box::new({
|
||||
move |output| match writeln!(stdout, "{}", output) {
|
||||
move |output| match writeln!(stdout, "{output}") {
|
||||
Ok(_) => (),
|
||||
Err(e) if e.kind() == ErrorKind::BrokenPipe => {
|
||||
// A process that was listening to bandwhich stdout has exited
|
||||
|
||||
@@ -261,7 +261,7 @@ pub fn os_input_output_factory(
|
||||
Some(stdout) => Box::new({
|
||||
move |output| {
|
||||
let mut stdout = stdout.lock().unwrap();
|
||||
writeln!(&mut stdout, "{}", output).unwrap();
|
||||
writeln!(&mut stdout, "{output}").unwrap();
|
||||
}
|
||||
}),
|
||||
None => Box::new(|_output| {}),
|
||||
|
||||
Reference in New Issue
Block a user