From 71ec20707d3dc6c2957fec62ca601ce87cb08db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:32:08 -0300 Subject: [PATCH 1/9] lib: drivers: fake: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/drivers/fake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::*; From f536a9500b77f17de145c30de93e194706f70f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:32:41 -0300 Subject: [PATCH 2/9] lib: drivers: mod: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/drivers/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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(); From 7d75f5f53db05d2c5232a3471617633bf09ead1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:32:57 -0300 Subject: [PATCH 3/9] lib: hub: mod: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/hub/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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, From 0534de301551e850ed7637dc8e75ec8963438027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:33:10 -0300 Subject: [PATCH 4/9] lib: logger: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/logger.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, } From 706b16820578b871fb7fa9f98f41eb4688c92962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:33:35 -0300 Subject: [PATCH 5/9] lib: stats: accumulated: driver: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/stats/accumulated/driver.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; From 9c9b6e7be6b0762814d7f22ecd225c80a1b9aa34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:34:07 -0300 Subject: [PATCH 6/9] lib: stats: accumulated: messages: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/stats/accumulated/messages.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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, From 64b30afef82e7c0fe30295e8d56cdb2866f3a7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:34:17 -0300 Subject: [PATCH 7/9] lib: stats: mod: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/stats/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)); From f55011c9a2a657a29a56ad6269db64af2ef1f891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:34:29 -0300 Subject: [PATCH 8/9] lib: stats: protocol: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/lib/stats/protocol.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 { From 8f1ec0420dfcfade8f90c47fd6a3a6d0b34f621c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 12 Dec 2024 11:35:05 -0300 Subject: [PATCH 9/9] main: Fix use order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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<()> {