Skip to content

Commit

Permalink
examples: tcp-server: style - fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cdbennett authored and uklotzde committed Mar 12, 2023
1 parent 167acf2 commit ea45e55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/tcp-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ impl tokio_modbus::server::Service for ExampleService {
_ => {
println!("SERVER: Exception::IllegalFunction - Unimplemented function code in request: {req:?}");
// TODO: We want to return a Modbus Exception response `IllegalFunction`. https://github.com/slowtec/tokio-modbus/issues/165
return future::ready(Err(std::io::Error::new(
future::ready(Err(std::io::Error::new(
std::io::ErrorKind::AddrNotAvailable,
format!("Unimplemented function code in request"),
)));
"Unimplemented function code in request".to_string(),
)))
}
}
}
Expand Down Expand Up @@ -179,7 +179,7 @@ async fn client_context(socket_addr: SocketAddr) {
assert_eq!(response, vec![1234, 5678]);

println!("CLIENT: Writing 2 holding registers...");
ctx.write_multiple_registers(0x01, &vec![7777, 8888])
ctx.write_multiple_registers(0x01, &[7777, 8888])
.await
.unwrap();

Expand Down

0 comments on commit ea45e55

Please sign in to comment.