diff --git a/clash_lib/src/app/logging.rs b/clash_lib/src/app/logging.rs index fbf3572da..02c422d61 100644 --- a/clash_lib/src/app/logging.rs +++ b/clash_lib/src/app/logging.rs @@ -7,10 +7,7 @@ use opentelemetry::{ KeyValue, }; use opentelemetry_otlp::SpanExporter; -use opentelemetry_sdk::{ - trace::{Config, TracerProvider}, - Resource, -}; +use opentelemetry_sdk::{trace::TracerProvider, Resource}; use opentelemetry_semantic_conventions::{ resource::{DEPLOYMENT_ENVIRONMENT_NAME, SERVICE_NAME, SERVICE_VERSION}, SCHEMA_URL, @@ -105,7 +102,7 @@ pub fn setup_logging( let exporter = SpanExporter::builder().with_tonic().build()?; let provider = TracerProvider::builder() - .with_config(Config::default().with_resource(Resource::from_schema_url( + .with_resource(Resource::from_schema_url( [ KeyValue::new(SERVICE_NAME, env!("CARGO_PKG_NAME")), KeyValue::new(SERVICE_VERSION, env!("CARGO_PKG_VERSION")), @@ -115,7 +112,7 @@ pub fn setup_logging( ), ], SCHEMA_URL, - ))) + )) .with_batch_exporter(exporter, opentelemetry_sdk::runtime::Tokio) .build(); diff --git a/clash_lib/src/proxy/wg/device.rs b/clash_lib/src/proxy/wg/device.rs index 3e401c71f..a604a0f24 100644 --- a/clash_lib/src/proxy/wg/device.rs +++ b/clash_lib/src/proxy/wg/device.rs @@ -736,7 +736,7 @@ pub struct RxToken { impl smoltcp::phy::RxToken for RxToken { fn consume(mut self, f: F) -> R where - F: FnOnce(&mut [u8]) -> R, + F: FnOnce(&[u8]) -> R, { f(&mut self.buffer) }