Skip to content

Commit

Permalink
fix(agent): fix log var, fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
gluax committed Mar 29, 2024
1 parent 9ccf2e5 commit 3cacd94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crates/snot-agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ async fn main() {
tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::builder()
.with_env_var("RUST_LOG")
.with_env_var("SNOT_AGENT_LOG")
.with_default_directive(LevelFilter::TRACE.into())
.parse_lossy("")
.from_env_lossy()
.add_directive("neli=off".parse().unwrap())
.add_directive("hyper_util=off".parse().unwrap())
.add_directive("reqwest=off".parse().unwrap())
Expand Down Expand Up @@ -208,7 +208,7 @@ async fn main() {
msg = server_response_out.recv() => {
let msg = msg.expect("internal RPC channel closed");
let bin = bincode::serialize(&MuxedMessageOutgoing::Agent(msg)).expect("failed to serialize response");
if let Err(_) = ws_stream.send(tungstenite::Message::Binary(bin)).await {
if (ws_stream.send(tungstenite::Message::Binary(bin)).await).is_err() {
error!("The connection to the control plane was interrupted");
break 'event;
}
Expand All @@ -218,7 +218,7 @@ async fn main() {
msg = client_request_out.recv() => {
let msg = msg.expect("internal RPC channel closed");
let bin = bincode::serialize(&MuxedMessageOutgoing::Control(msg)).expect("failed to serialize request");
if let Err(_) = ws_stream.send(tungstenite::Message::Binary(bin)).await {
if (ws_stream.send(tungstenite::Message::Binary(bin)).await).is_err() {
error!("The connection to the control plane was interrupted");
break 'event;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/snot-agent/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn init(state: Arc<GlobalState>) {
}

/// Parse the metrics blob when scraping the snarkOS Prometheus exporter.
fn parse_metrics<'a>(source: &'a str) -> ParsedMetrics<'a> {
fn parse_metrics(source: &str) -> ParsedMetrics<'_> {
source
.split('\n')
.map(str::trim)
Expand Down

0 comments on commit 3cacd94

Please sign in to comment.