diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d8feade..b4917fd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: -Dwarnings RUSTDOCFLAGS: -Dwarnings - MSRV: "1.81" + MSRV: "1.85" SCCACHE_CACHE_SIZE: "10G" IROH_FORCE_STAGING_RELAYS: "1" diff --git a/Cargo.toml b/Cargo.toml index 3508d8b..d769a71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["iroh-metrics-derive"] [package] name = "iroh-metrics" version = "0.36.2" -edition = "2021" +edition = "2024" readme = "README.md" description = "metrics for iroh" license = "MIT OR Apache-2.0" @@ -12,7 +12,7 @@ authors = ["arqu ", "n0 team"] repository = "https://github.com/n0-computer/iroh-metrics" # Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.81" +rust-version = "1.85" [lints.rust] missing_debug_implementations = "warn" diff --git a/iroh-metrics-derive/Cargo.toml b/iroh-metrics-derive/Cargo.toml index 507eb1e..05b7638 100644 --- a/iroh-metrics-derive/Cargo.toml +++ b/iroh-metrics-derive/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "iroh-metrics-derive" version = "0.3.1" -edition = "2021" +edition = "2024" description = "derive macros for iroh-metrics" license = "MIT OR Apache-2.0" authors = ["Frando ", "n0 team"] repository = "https://github.com/n0-computer/iroh-metrics" # Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.81" +rust-version = "1.85" [lib] proc-macro = true diff --git a/iroh-metrics-derive/src/lib.rs b/iroh-metrics-derive/src/lib.rs index ec63222..12718bb 100644 --- a/iroh-metrics-derive/src/lib.rs +++ b/iroh-metrics-derive/src/lib.rs @@ -2,8 +2,8 @@ use heck::ToSnakeCase; use proc_macro::TokenStream; use quote::quote; use syn::{ - meta::ParseNestedMeta, parse_macro_input, spanned::Spanned, Attribute, Data, DeriveInput, - Error, Expr, ExprLit, Fields, Ident, Lit, LitStr, + Attribute, Data, DeriveInput, Error, Expr, ExprLit, Fields, Ident, Lit, LitStr, + meta::ParseNestedMeta, parse_macro_input, spanned::Spanned, }; #[proc_macro_derive(MetricsGroup, attributes(metrics, default))] diff --git a/src/base.rs b/src/base.rs index 00f07aa..59f4787 100644 --- a/src/base.rs +++ b/src/base.rs @@ -1,9 +1,9 @@ use std::{any::Any, sync::Arc}; use crate::{ + Metric, MetricType, MetricValue, encoding::EncodableMetric, iterable::{FieldIter, IntoIterable, Iterable}, - Metric, MetricType, MetricValue, }; /// Trait for structs containing metric items. @@ -120,9 +120,9 @@ mod tests { use super::*; use crate::{ + Counter, Gauge, Histogram, MetricType, MetricsGroupSet, MetricsSource, Registry, encoding::{Decoder, Encoder}, iterable::Iterable, - Counter, Gauge, Histogram, MetricType, MetricsGroupSet, MetricsSource, Registry, }; #[derive(Debug, Iterable, Serialize, Deserialize)] diff --git a/src/registry.rs b/src/registry.rs index d362ed3..923ae6b 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -5,12 +5,12 @@ use std::{ fmt::{self, Write}, ops::Deref, sync::{ - atomic::{AtomicU64, Ordering}, Arc, RwLock, + atomic::{AtomicU64, Ordering}, }, }; -use crate::{encoding::write_eof, Error, MetricsGroup, MetricsGroupSet}; +use crate::{Error, MetricsGroup, MetricsGroupSet, encoding::write_eof}; /// A registry for [`MetricsGroup`]. #[derive(Debug, Default)] diff --git a/src/service.rs b/src/service.rs index 5303611..954c212 100644 --- a/src/service.rs +++ b/src/service.rs @@ -5,11 +5,11 @@ use std::{ time::{Duration, Instant}, }; -use hyper::{service::service_fn, Request, Response}; +use hyper::{Request, Response, service::service_fn}; use tokio::{io::AsyncWriteExt as _, net::TcpListener}; use tracing::{debug, error, info, warn}; -use crate::{parse_prometheus_metrics, Error, MetricsSource}; +use crate::{Error, MetricsSource, parse_prometheus_metrics}; type BytesBody = http_body_util::Full; diff --git a/src/static_core.rs b/src/static_core.rs index 5df9058..d3372fd 100644 --- a/src/static_core.rs +++ b/src/static_core.rs @@ -12,7 +12,7 @@ //! ```rust //! use std::sync::Arc; //! -//! use iroh_metrics::{inc, inc_by, static_core::Core, Counter, MetricsGroup}; +//! use iroh_metrics::{Counter, MetricsGroup, inc, inc_by, static_core::Core}; //! //! #[derive(Debug, Default, MetricsGroup)] //! #[metrics(name = "my_metrics")]