From c09fc230887ed6f6613cf91472c290d61c53276e Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 24 Apr 2023 13:41:43 -0400 Subject: [PATCH] chore: Fix cargo deny warnings (#1374) --- deny.toml | 1 - interop/Cargo.toml | 2 +- interop/src/lib.rs | 7 +------ tests/integration_tests/Cargo.toml | 2 +- tests/integration_tests/src/lib.rs | 4 +--- tests/integration_tests/tests/status.rs | 10 ++-------- 6 files changed, 6 insertions(+), 20 deletions(-) diff --git a/deny.toml b/deny.toml index cb06e89..789212c 100644 --- a/deny.toml +++ b/deny.toml @@ -34,7 +34,6 @@ allow = [ "OpenSSL", "Zlib", "Unicode-DFS-2016", - "MPL-2.0", ] [[licenses.clarify]] diff --git a/interop/Cargo.toml b/interop/Cargo.toml index ad7d35d..3878651 100644 --- a/interop/Cargo.toml +++ b/interop/Cargo.toml @@ -31,7 +31,7 @@ tonic = {path = "../tonic", features = ["tls"]} tower = {version = "0.4"} tracing = "0.1" tracing-log = "0.1" -tracing-subscriber = {version = "0.3", features = ["env-filter"]} +tracing-subscriber = {version = "0.3"} [build-dependencies] tonic-build = {path = "../tonic-build", features = ["prost"]} diff --git a/interop/src/lib.rs b/interop/src/lib.rs index 7c279c8..a2bfc33 100644 --- a/interop/src/lib.rs +++ b/interop/src/lib.rs @@ -12,12 +12,7 @@ pub mod pb { use std::{default, fmt, iter}; pub fn trace_init() { - let sub = tracing_subscriber::FmtSubscriber::builder() - .with_env_filter(tracing_subscriber::filter::EnvFilter::from_default_env()) - .finish(); - - let _ = tracing::subscriber::set_global_default(sub); - let _ = tracing_log::LogTracer::init(); + tracing_subscriber::fmt::init(); } pub fn client_payload(size: usize) -> pb::Payload { diff --git a/tests/integration_tests/Cargo.toml b/tests/integration_tests/Cargo.toml index 957d936..01420d6 100644 --- a/tests/integration_tests/Cargo.toml +++ b/tests/integration_tests/Cargo.toml @@ -14,7 +14,7 @@ futures-util = "0.3" prost = "0.11" tokio = {version = "1.0", features = ["macros", "rt-multi-thread", "net"]} tonic = {path = "../../tonic"} -tracing-subscriber = {version = "0.3", features = ["env-filter"]} +tracing-subscriber = {version = "0.3"} [dev-dependencies] async-stream = "0.3" diff --git a/tests/integration_tests/src/lib.rs b/tests/integration_tests/src/lib.rs index 7c6e237..3533aa6 100644 --- a/tests/integration_tests/src/lib.rs +++ b/tests/integration_tests/src/lib.rs @@ -55,7 +55,5 @@ pub mod mock { } pub fn trace_init() { - let _ = tracing_subscriber::FmtSubscriber::builder() - .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) - .try_init(); + tracing_subscriber::fmt::init(); } diff --git a/tests/integration_tests/tests/status.rs b/tests/integration_tests/tests/status.rs index 55182ec..8fcb287 100644 --- a/tests/integration_tests/tests/status.rs +++ b/tests/integration_tests/tests/status.rs @@ -130,7 +130,7 @@ type Stream = #[tokio::test] async fn status_from_server_stream() { - trace_init(); + integration_tests::trace_init(); struct Svc; @@ -178,7 +178,7 @@ async fn status_from_server_stream() { #[tokio::test] async fn status_from_server_stream_with_source() { - trace_init(); + integration_tests::trace_init(); let channel = Endpoint::try_from("http://[::]:50051") .unwrap() @@ -193,9 +193,3 @@ async fn status_from_server_stream_with_source() { let source = error.source().unwrap(); source.downcast_ref::().unwrap(); } - -fn trace_init() { - let _ = tracing_subscriber::FmtSubscriber::builder() - .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) - .try_init(); -}