From e224e74389f8f7f5fea96cc3845db2bfc586cd4e Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Tue, 10 Sep 2024 13:41:04 +0200 Subject: [PATCH] Simplify imports --- src/client/sync/mod.rs | 3 +-- src/prelude.rs | 3 +-- tests/exception/mod.rs | 2 +- tests/rtu_all_exceptions.rs | 5 +---- tests/tcp_all_exceptions.rs | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/client/sync/mod.rs b/src/client/sync/mod.rs index 1943237b..a68f0b3a 100644 --- a/src/client/sync/mod.rs +++ b/src/client/sync/mod.rs @@ -16,8 +16,7 @@ use futures_util::future::Either; use crate::{frame::*, Result, Slave}; use super::{ - Client as AsyncClient, Context as AsyncContext, Reader as AsyncReader, SlaveContext, - Writer as AsyncWriter, + Client as AsyncClient, Context as AsyncContext, Reader as _, SlaveContext, Writer as _, }; fn block_on_with_timeout( diff --git a/src/prelude.rs b/src/prelude.rs index 45139aae..28ab8b66 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -29,8 +29,7 @@ pub mod sync { /////////////////////////////////////////////////////////////////// /// Types /////////////////////////////////////////////////////////////////// -pub use crate::{Exception, ProtocolError, Request, Response}; -pub use crate::{Slave, SlaveId}; +pub use crate::{Exception, ProtocolError, Request, Response, Slave, SlaveId}; #[cfg(feature = "server")] pub use crate::frame::SlaveRequest; diff --git a/tests/exception/mod.rs b/tests/exception/mod.rs index 0a973482..3205b66c 100644 --- a/tests/exception/mod.rs +++ b/tests/exception/mod.rs @@ -4,7 +4,7 @@ use std::future; use tokio_modbus::{ - client::{Context, Reader, Writer}, + client::{Context, Reader as _, Writer as _}, server::Service, Exception, Request, Response, }; diff --git a/tests/rtu_all_exceptions.rs b/tests/rtu_all_exceptions.rs index 890fa315..ae790ee2 100644 --- a/tests/rtu_all_exceptions.rs +++ b/tests/rtu_all_exceptions.rs @@ -10,10 +10,7 @@ mod exception; use std::{thread, time::Duration}; use exception::check_client_context; -use tokio_modbus::{ - client::{self}, - server::rtu::Server, -}; +use tokio_modbus::{client, server::rtu::Server}; use tokio_serial::SerialPortBuilder; use crate::exception::TestService; diff --git a/tests/tcp_all_exceptions.rs b/tests/tcp_all_exceptions.rs index ed059231..30dbee72 100644 --- a/tests/tcp_all_exceptions.rs +++ b/tests/tcp_all_exceptions.rs @@ -12,7 +12,7 @@ use std::{net::SocketAddr, time::Duration}; use exception::check_client_context; use tokio::net::TcpListener; use tokio_modbus::{ - client::{self}, + client, server::tcp::{accept_tcp_connection, Server}, };