Fix minor clippy warnings

main
Laurent Pelecq 2 years ago
parent 39c2317de9
commit c45bb7daa7

@ -115,7 +115,7 @@ mod asynchronous {
} }
impl FifoBuilder { impl FifoBuilder {
pub fn new() -> FifoBuilder { pub fn new() -> Self {
FifoBuilder { FifoBuilder {
path: FifoPath::new(), path: FifoPath::new(),
} }
@ -149,6 +149,12 @@ mod asynchronous {
#[cfg(feature = "async-mio")] #[cfg(feature = "async-mio")]
pub use asynchronous::{FifoBuilder, UnixStream}; pub use asynchronous::{FifoBuilder, UnixStream};
impl Default for FifoBuilder {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {

@ -84,15 +84,13 @@ fn basic_async_communication() -> std::io::Result<()> {
while controler.step() < 2 { while controler.step() < 2 {
poll.poll(&mut events, None)?; poll.poll(&mut events, None)?;
for event in &events { for event in &events {
if event.token() == output_token && event.is_writable() { if event.token() == output_token && event.is_writable() && controler.step() == 0 {
if controler.step() == 0 { controler.check_result(client.set_client_name(ClientName::new("test", "test")));
controler } else if event.token() == input_token
.check_result(client.set_client_name(ClientName::new("test", "test"))); && event.is_readable()
} && controler.step() == 1
} else if event.token() == input_token && event.is_readable() { {
if controler.step() == 1 { controler.check_result(client.check_client_name_set());
controler.check_result(client.check_client_name_set());
}
} }
} }
} }

Loading…
Cancel
Save