diff --git a/src/lib/drivers/fake.rs b/src/lib/drivers/fake.rs index f245a0e1..d5ef4aec 100644 --- a/src/lib/drivers/fake.rs +++ b/src/lib/drivers/fake.rs @@ -1,7 +1,7 @@ -use bytes::{BufMut, BytesMut}; use std::sync::Arc; use anyhow::Result; +use bytes::{BufMut, BytesMut}; use mavlink_codec::{v2::V2Packet, Packet}; use tokio::sync::{broadcast, RwLock}; use tracing::*; diff --git a/src/lib/drivers/mod.rs b/src/lib/drivers/mod.rs index 8287d0fe..7dec478e 100644 --- a/src/lib/drivers/mod.rs +++ b/src/lib/drivers/mod.rs @@ -241,13 +241,12 @@ mod tests { use tokio::sync::RwLock; use tracing::*; + use super::*; use crate::{ callbacks::{Callbacks, MessageCallback}, stats::{accumulated::driver::AccumulatedDriverStats, driver::DriverUuid}, }; - use super::*; - #[test] fn test_unique_endpoints() { let mut unique_types = HashSet::new(); diff --git a/src/lib/hub/mod.rs b/src/lib/hub/mod.rs index 7d0268d8..527b8bda 100644 --- a/src/lib/hub/mod.rs +++ b/src/lib/hub/mod.rs @@ -3,9 +3,11 @@ mod protocol; use std::sync::{Arc, Mutex}; +use actor::HubActor; use anyhow::Result; use indexmap::IndexMap; use lazy_static::lazy_static; +use protocol::HubCommand; use tokio::sync::{broadcast, mpsc, oneshot, RwLock}; use crate::{ @@ -21,9 +23,6 @@ use crate::{ }, }; -use actor::HubActor; -use protocol::HubCommand; - lazy_static! { static ref HUB: Hub = Hub::new( 10000, diff --git a/src/lib/logger.rs b/src/lib/logger.rs index 370a768b..7df4d922 100644 --- a/src/lib/logger.rs +++ b/src/lib/logger.rs @@ -3,8 +3,6 @@ use std::{ sync::{Arc, Mutex}, }; -use crate::cli; - use lazy_static::lazy_static; use ringbuffer::{AllocRingBuffer, RingBuffer}; use tokio::sync::broadcast::{Receiver, Sender}; @@ -16,6 +14,8 @@ use tracing_subscriber::{ EnvFilter, Layer, }; +use crate::cli; + struct BroadcastWriter { sender: Sender, } diff --git a/src/lib/stats/accumulated/driver.rs b/src/lib/stats/accumulated/driver.rs index f0741991..5adb12b7 100644 --- a/src/lib/stats/accumulated/driver.rs +++ b/src/lib/stats/accumulated/driver.rs @@ -3,9 +3,8 @@ use std::sync::Arc; use indexmap::IndexMap; use serde::Serialize; -use crate::{drivers::DriverInfo, protocol::Protocol, stats::driver::DriverUuid}; - use super::AccumulatedStatsInner; +use crate::{drivers::DriverInfo, protocol::Protocol, stats::driver::DriverUuid}; pub type AccumulatedDriversStats = IndexMap; diff --git a/src/lib/stats/accumulated/messages.rs b/src/lib/stats/accumulated/messages.rs index 49890707..8320d3ff 100644 --- a/src/lib/stats/accumulated/messages.rs +++ b/src/lib/stats/accumulated/messages.rs @@ -3,13 +3,12 @@ use std::sync::Arc; use indexmap::IndexMap; use serde::Serialize; +use super::AccumulatedStatsInner; use crate::{ protocol::Protocol, stats::messages::{ComponentId, MessageId, SystemId}, }; -use super::AccumulatedStatsInner; - #[derive(Default, Clone, Debug, Serialize)] pub struct AccumulatedHubMessagesStats { pub systems_messages_stats: IndexMap, diff --git a/src/lib/stats/mod.rs b/src/lib/stats/mod.rs index 21eef7f7..8286c4fa 100644 --- a/src/lib/stats/mod.rs +++ b/src/lib/stats/mod.rs @@ -6,16 +6,15 @@ mod protocol; use std::sync::{Arc, Mutex}; -use anyhow::Result; -use lazy_static::lazy_static; -use serde::Serialize; -use tokio::sync::{mpsc, oneshot}; - use accumulated::AccumulatedStatsInner; use actor::StatsActor; +use anyhow::Result; use driver::DriversStats; +use lazy_static::lazy_static; use messages::HubMessagesStats; use protocol::StatsCommand; +use serde::Serialize; +use tokio::sync::{mpsc, oneshot}; lazy_static! { static ref STATS: Stats = Stats::new(tokio::time::Duration::from_secs(1)); diff --git a/src/lib/stats/protocol.rs b/src/lib/stats/protocol.rs index b0b9a9e6..5381310f 100644 --- a/src/lib/stats/protocol.rs +++ b/src/lib/stats/protocol.rs @@ -1,9 +1,8 @@ use anyhow::Result; use tokio::sync::{mpsc, oneshot}; -use crate::stats::{DriversStats, StatsInner}; - use super::messages::HubMessagesStats; +use crate::stats::{DriversStats, StatsInner}; pub enum StatsCommand { SetPeriod { diff --git a/src/main.rs b/src/main.rs index bfedf699..649859f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ use anyhow::*; -use tracing::*; - use mavlink_server::{cli, hub, logger, web}; +use tracing::*; #[tokio::main(flavor = "multi_thread", worker_threads = 10)] async fn main() -> Result<()> {