Skip to content

Commit a7c1d02

Browse files
Remove lazy_static dependency
1 parent 089491a commit a7c1d02

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ err-context = "0.1.0"
3232
log = "0.4.11"
3333
futures = "0.3.31"
3434
clap = { version = "4.0", features = ["derive"], optional = true }
35-
lazy_static = "1.4.0"
3635

3736
# Only used by the binaries in src/bin/ and is optional so it's not
3837
# pulled in when built as a library.

src/logging.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use std::fmt;
2+
use std::sync::LazyLock;
23

3-
lazy_static::lazy_static! {
4-
/// If true, redact IPs and other user sensitive data from logs
5-
static ref REDACT_LOGS: bool = std::env::var("REDACT_LOGS")
4+
/// If true, redact IPs and other user sensitive data from logs
5+
static REDACT_LOGS: LazyLock<bool> = LazyLock::new(|| {
6+
std::env::var("REDACT_LOGS")
67
.map(|v| v != "0")
7-
.unwrap_or(false);
8-
}
8+
.unwrap_or(false)
9+
});
910

1011
/// Wrap any displayable type in this to have its Display/Debug format be redacted at runtime
1112
/// if the user so wish. Makes it possible to log more extensively without collecting user

0 commit comments

Comments
 (0)