Skip to content

Commit

Permalink
fix cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Dec 14, 2024
1 parent 1bb1f42 commit 6210556
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
32 changes: 16 additions & 16 deletions libs/net4mqtt/src/topic.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/// Publish:
/// TOPIC: <prefix>/<agent id>/<local id>/<label>/<protocol>/<src(address:port)>/<dst(address:port)>
///
/// Pub topic example: prefix/agent-0/local-0/i/udp/127.0.0.1:4444/127.0.0.1:4433
/// Pub topic example: prefix/agent-0/local-0/o/udp/127.0.0.1:4444/127.0.0.1:4433
///
/// Subscribe:
/// TOPIC: <prefix>/< + | agent id>/< + | local id>/<label>/#
///
/// Sub topic example: prefix/+/local-0/i/#
/// Sub topic example: prefix/agent-0/+/o/#
///
/// About MQTT online status (Option)
///
/// TOPIC: prefix/agent-0/local-0/v/-
/// Retain: true
//! Publish:
//! TOPIC: <prefix>/<agent id>/<local id>/<label>/<protocol>/<src(address:port)>/<dst(address:port)>
//!
//! Pub topic example: prefix/agent-0/local-0/i/udp/127.0.0.1:4444/127.0.0.1:4433
//! Pub topic example: prefix/agent-0/local-0/o/udp/127.0.0.1:4444/127.0.0.1:4433
//!
//! Subscribe:
//! TOPIC: <prefix>/< + | agent id>/< + | local id>/<label>/#
//!
//! Sub topic example: prefix/+/local-0/i/#
//! Sub topic example: prefix/agent-0/+/o/#
//!
//! About MQTT online status (Option)
//!
//! TOPIC: prefix/agent-0/local-0/v/-
//! Retain: true
pub const ANY: &str = "+";
pub const ALL: &str = "#";
Expand Down
2 changes: 1 addition & 1 deletion libs/signal/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// References: https://stackoverflow.com/questions/77585473/rust-tokio-how-to-handle-more-signals-than-just-sigint-i-e-sigquit
//! References: https://stackoverflow.com/questions/77585473/rust-tokio-how-to-handle-more-signals-than-just-sigint-i-e-sigquit
/// Waits for a signal that requests a graceful shutdown, like SIGTERM or SIGINT.
#[cfg(unix)]
Expand Down
6 changes: 4 additions & 2 deletions liveion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tokio::net::TcpListener;
use tower_http::{
cors::CorsLayer, trace::TraceLayer, validate_request::ValidateRequestHeaderLayer,
};
use tracing::{error, info_span, warn, Level};
use tracing::{error, info_span, Level};

use auth::{access::access_middleware, ManyValidate};
use error::AppError;
Expand Down Expand Up @@ -110,7 +110,9 @@ where
)
.await
{
Ok(_) => warn!("net4mqtt service is end, restart net4mqtt service"),
Ok(_) => tracing::warn!(
"net4mqtt service is end, restart net4mqtt service"
),
Err(e) => error!("mqtt4mqtt error: {:?}", e),
}
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
Expand Down
6 changes: 4 additions & 2 deletions liveman/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tokio::net::TcpListener;
use tower_http::{
cors::CorsLayer, trace::TraceLayer, validate_request::ValidateRequestHeaderLayer,
};
use tracing::{error, info, info_span, warn};
use tracing::{error, info, info_span};

use crate::admin::{authorize, token};
use crate::config::Config;
Expand Down Expand Up @@ -97,7 +97,9 @@ where
)
.await
{
Ok(_) => warn!("net4mqtt service is end, restart net4mqtt service"),
Ok(_) => tracing::warn!(
"net4mqtt service is end, restart net4mqtt service"
),
Err(e) => error!("mqtt4mqtt error: {:?}", e),
}
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
Expand Down

0 comments on commit 6210556

Please sign in to comment.