diff --git a/examples/read_serialport.rs b/examples/read_serialport.rs index 98bd1da..1a416ae 100644 --- a/examples/read_serialport.rs +++ b/examples/read_serialport.rs @@ -76,7 +76,7 @@ pub fn main() -> io::Result<()> { // This should never happen as we only registered our // `UdpSocket` using the `UDP_SOCKET` token, but if it ever // does we'll log it. - error!("Got event for unexpected token: {:?}", event); + error!("Got event for unexpected token: {event:?}"); } } } diff --git a/src/lib.rs b/src/lib.rs index f8379ce..9fd5150 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,9 +64,7 @@ mod os_prelude { pub use winapi::um::fileapi::*; pub use winapi::um::handleapi::INVALID_HANDLE_VALUE; pub use winapi::um::winbase::{COMMTIMEOUTS, FILE_FLAG_OVERLAPPED}; - pub use winapi::um::winnt::{ - FILE_ATTRIBUTE_NORMAL, GENERIC_READ, GENERIC_WRITE, HANDLE, - }; + pub use winapi::um::winnt::{FILE_ATTRIBUTE_NORMAL, GENERIC_READ, GENERIC_WRITE, HANDLE}; } use os_prelude::*; @@ -668,7 +666,7 @@ mod io { } } - impl<'a> Read for &'a SerialStream { + impl Read for &SerialStream { fn read(&mut self, bytes: &mut [u8]) -> StdIoResult { uninterruptibly!(match unsafe { libc::read( @@ -683,7 +681,7 @@ mod io { } } - impl<'a> Write for &'a SerialStream { + impl Write for &SerialStream { fn write(&mut self, bytes: &[u8]) -> StdIoResult { uninterruptibly!(match unsafe { libc::write( diff --git a/tests/common.rs b/tests/common.rs index b0dd7b6..d6c867f 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -188,9 +188,9 @@ impl Drop for Fixture { self.process.kill().ok(); thread::sleep(Duration::from_millis(1000)); log::trace!("removing link: {:?}", self.port_a); - std::fs::remove_file(&self.port_a).ok(); + std::fs::remove_file(self.port_a).ok(); log::trace!("removing link: {:?}", self.port_b); - std::fs::remove_file(&self.port_b).ok(); + std::fs::remove_file(self.port_b).ok(); thread::sleep(Duration::from_millis(1000)); } } @@ -200,14 +200,11 @@ impl Fixture { pub fn new(port_a: &'static str, port_b: &'static str) -> Self { use std::sync::atomic::{AtomicUsize, Ordering}; static N: AtomicUsize = AtomicUsize::new(0); - LOGGING_INIT.call_once(|| env_logger::init()); + LOGGING_INIT.call_once(env_logger::init); let n = N.fetch_add(1, Ordering::Relaxed); - let port_a = format!("{}{}", port_a, n).leak(); - let port_b = format!("{}{}", port_b, n).leak(); - let args = [ - format!("PTY,link={}", port_a), - format!("PTY,link={}", port_b), - ]; + let port_a = format!("{port_a}{n}").leak(); + let port_b = format!("{port_b}{n}").leak(); + let args = [format!("PTY,link={port_a}"), format!("PTY,link={port_b}")]; log::trace!("starting process: socat {} {}", args[0], args[1]); let process = process::Command::new("socat")