Skip to content

Commit 111d5c0

Browse files
committed
fix: security/dependabot/1
1 parent 2dd70bb commit 111d5c0

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

agent/Cargo.lock

Lines changed: 1 addition & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66
[dependencies]
77
tracing = "0.1"
88
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
9-
atty = "0.2"
109

1110
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "signal", "sync", "time"] }
1211
rumqttc = { version = "0.24", features = ["use-rustls", "url"] }

agent/examples/publish_command.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::env;
2+
use std::io::IsTerminal;
23
use std::path::PathBuf;
34
use rumqttc::v5::{AsyncClient, MqttOptions, Incoming};
45
use rumqttc::v5::mqttbytes::QoS;
@@ -16,9 +17,10 @@ async fn main() -> anyhow::Result<()> {
1617

1718
let config_path:PathBuf = "./config.yml".parse().unwrap();
1819

19-
let is_atty = atty::is(atty::Stream::Stdout);
20+
let is_terminal = std::io::stdout().is_terminal();
21+
2022
tracing_subscriber::fmt().with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::from("debug")),)
21-
.with_ansi(is_atty).init();
23+
.with_ansi(is_terminal).init();
2224

2325
let config = mproxy::config::Config::new(Some(config_path)).unwrap();
2426

agent/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
1+
use std::io::IsTerminal;
32
use anyhow::Context;
43
use clap::{Parser, ArgGroup};
54
use std::path::PathBuf;
@@ -33,10 +32,10 @@ async fn main() -> anyhow::Result<()> {
3332
}
3433
});
3534

36-
let is_atty = atty::is(atty::Stream::Stdout);
35+
let is_terminal = std::io::stdout().is_terminal();
3736

3837
tracing_subscriber::fmt().with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::from("info")),)
39-
.with_ansi(is_atty).init();
38+
.with_ansi(is_terminal).init();
4039

4140
let config = mproxy::config::Config::new(ops.config_path).with_context(|| "Config can not load")?;
4241

0 commit comments

Comments
 (0)