From bf59803f0090d1784b92e30d5b0ce3520024ef5b Mon Sep 17 00:00:00 2001 From: Starnick4444 Date: Fri, 2 May 2025 22:55:13 +0200 Subject: [PATCH] chore(tracing): upgrade to 2024 edition Part of #114 Change-Id: I07f1c861c110cc2e0a3d8122bb6f240391212698 Reviewed-on: https://cl.snix.dev/c/snix/+/30378 Autosubmit: Bence Nemes Reviewed-by: Florian Klink Tested-by: besadii --- contrib/weave/Cargo.nix | 2 +- snix/Cargo.nix | 2 +- snix/tracing/Cargo.toml | 2 +- snix/tracing/rustfmt.toml | 2 ++ snix/tracing/src/lib.rs | 6 +++--- 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 snix/tracing/rustfmt.toml diff --git a/contrib/weave/Cargo.nix b/contrib/weave/Cargo.nix index a05f90e90..09f9e59ba 100644 --- a/contrib/weave/Cargo.nix +++ b/contrib/weave/Cargo.nix @@ -6218,7 +6218,7 @@ rec { "snix-tracing" = rec { crateName = "snix-tracing"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ../../snix/tracing; }; libName = "snix_tracing"; dependencies = [ diff --git a/snix/Cargo.nix b/snix/Cargo.nix index 0f42b38e7..3fd0edbc7 100644 --- a/snix/Cargo.nix +++ b/snix/Cargo.nix @@ -14803,7 +14803,7 @@ rec { "snix-tracing" = rec { crateName = "snix-tracing"; version = "0.1.0"; - edition = "2021"; + edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ./tracing; }; libName = "snix_tracing"; dependencies = [ diff --git a/snix/tracing/Cargo.toml b/snix/tracing/Cargo.toml index 88ee561dc..f4e2e4548 100644 --- a/snix/tracing/Cargo.toml +++ b/snix/tracing/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "snix-tracing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] tracing = { workspace = true, features = ["max_level_trace", "release_max_level_debug"] } diff --git a/snix/tracing/rustfmt.toml b/snix/tracing/rustfmt.toml new file mode 100644 index 000000000..4dfc1d2b7 --- /dev/null +++ b/snix/tracing/rustfmt.toml @@ -0,0 +1,2 @@ +# FUTUREWORK: move to .. once all crates are migrated (#114) +edition = "2024" diff --git a/snix/tracing/src/lib.rs b/snix/tracing/src/lib.rs index 28ecfdf5b..7fe97a4f0 100644 --- a/snix/tracing/src/lib.rs +++ b/snix/tracing/src/lib.rs @@ -2,17 +2,17 @@ use indicatif::ProgressStyle; use std::sync::LazyLock; use tracing::level_filters::LevelFilter; use tracing_indicatif::{ - filter::IndicatifFilter, util::FilteredFormatFields, writer, IndicatifLayer, IndicatifWriter, + IndicatifLayer, IndicatifWriter, filter::IndicatifFilter, util::FilteredFormatFields, writer, }; use tracing_subscriber::{ + EnvFilter, Layer, Registry, layer::{Identity, SubscriberExt}, util::SubscriberInitExt as _, - EnvFilter, Layer, Registry, }; #[cfg(feature = "otlp")] use opentelemetry_sdk::{ - propagation::TraceContextPropagator, resource::SdkProvidedResourceDetector, Resource, + Resource, propagation::TraceContextPropagator, resource::SdkProvidedResourceDetector, }; #[cfg(feature = "tracy")] use tracing_tracy::TracyLayer;