diff --git a/src/drivers/fake.rs b/src/drivers/fake.rs index b2132e90..2c55e9a3 100644 --- a/src/drivers/fake.rs +++ b/src/drivers/fake.rs @@ -5,12 +5,10 @@ use tokio::sync::broadcast; use tracing::*; use crate::{ - drivers::{Driver, DriverInfo}, + drivers::{Driver, DriverInfo, OnMessageCallback, OnMessageCallbackExt}, protocol::{read_all_messages, Protocol}, }; -use super::{OnMessageCallback, OnMessageCallbackExt}; - #[derive(Default)] pub struct FakeSink { on_message: OnMessageCallback>, diff --git a/src/drivers/file/server.rs b/src/drivers/file/server.rs index 08b02ec3..b2252533 100644 --- a/src/drivers/file/server.rs +++ b/src/drivers/file/server.rs @@ -7,8 +7,10 @@ use std::path::PathBuf; use tokio::sync::broadcast; use tracing::*; -use crate::drivers::{Driver, DriverExt, DriverInfo, OnMessageCallback, OnMessageCallbackExt}; -use crate::protocol::Protocol; +use crate::{ + drivers::{Driver, DriverExt, DriverInfo, OnMessageCallback, OnMessageCallbackExt}, + protocol::Protocol, +}; pub struct FileServer { pub path: PathBuf, diff --git a/src/drivers/tcp/client.rs b/src/drivers/tcp/client.rs index bba0bf8a..7796c703 100644 --- a/src/drivers/tcp/client.rs +++ b/src/drivers/tcp/client.rs @@ -1,13 +1,16 @@ use std::sync::Arc; -use crate::drivers::tcp::{tcp_receive_task, tcp_send_task}; -use crate::protocol::Protocol; use anyhow::Result; -use tokio::net::TcpStream; -use tokio::sync::broadcast; +use tokio::{net::TcpStream, sync::broadcast}; use tracing::*; -use crate::drivers::{Driver, DriverExt, DriverInfo}; +use crate::{ + drivers::{ + tcp::{tcp_receive_task, tcp_send_task}, + Driver, DriverExt, DriverInfo, + }, + protocol::Protocol, +}; pub struct TcpClient { pub remote_addr: String, diff --git a/src/drivers/tcp/server.rs b/src/drivers/tcp/server.rs index b581073f..0974fc42 100644 --- a/src/drivers/tcp/server.rs +++ b/src/drivers/tcp/server.rs @@ -1,13 +1,19 @@ use std::sync::Arc; -use crate::drivers::tcp::{tcp_receive_task, tcp_send_task}; -use crate::protocol::Protocol; use anyhow::Result; -use tokio::net::{TcpListener, TcpStream}; -use tokio::sync::broadcast; +use tokio::{ + net::{TcpListener, TcpStream}, + sync::broadcast, +}; use tracing::*; -use crate::drivers::{Driver, DriverExt, DriverInfo}; +use crate::{ + drivers::{ + tcp::{tcp_receive_task, tcp_send_task}, + Driver, DriverExt, DriverInfo, + }, + protocol::Protocol, +}; pub struct TcpServer { pub local_addr: String, diff --git a/src/drivers/udp/client.rs b/src/drivers/udp/client.rs index 3fbb343c..ddbdb88f 100644 --- a/src/drivers/udp/client.rs +++ b/src/drivers/udp/client.rs @@ -1,11 +1,13 @@ -use crate::protocol::{read_all_messages, Protocol}; -use anyhow::Result; use std::sync::Arc; -use tokio::net::UdpSocket; -use tokio::sync::broadcast; + +use anyhow::Result; +use tokio::{net::UdpSocket, sync::broadcast}; use tracing::*; -use crate::drivers::{Driver, DriverExt, DriverInfo}; +use crate::{ + drivers::{Driver, DriverExt, DriverInfo}, + protocol::{read_all_messages, Protocol}, +}; pub struct UdpClient { pub remote_addr: String, diff --git a/src/drivers/udp/server.rs b/src/drivers/udp/server.rs index 98931269..99722f56 100644 --- a/src/drivers/udp/server.rs +++ b/src/drivers/udp/server.rs @@ -1,11 +1,16 @@ -use anyhow::Result; use std::{collections::HashMap, sync::Arc}; -use tokio::net::UdpSocket; -use tokio::sync::{broadcast, RwLock}; + +use anyhow::Result; +use tokio::{ + net::UdpSocket, + sync::{broadcast, RwLock}, +}; use tracing::*; -use crate::drivers::{Driver, DriverExt, DriverInfo}; -use crate::protocol::{read_all_messages, Protocol}; +use crate::{ + drivers::{Driver, DriverExt, DriverInfo}, + protocol::{read_all_messages, Protocol}, +}; pub struct UdpServer { pub local_addr: String,