Skip to content

Commit 6c4bfb3

Browse files
authored
chore!: Upgrade to rust 2024 edition and bump MSRV to 1.85 (#57)
## Description - Upgrades the rust edition from 2021 to 2024 in iroh-metrics and iroh-metrics-derive - Bumps the MSRV from 1.81 to 1.85 in all crates and CI. ## Breaking Changes - Rust edition bumped to 2024 - Minimum supported rust version bumped to 1.85 ## Change checklist - [x] Self-review. - [x] All breaking changes documented.
1 parent dc7630b commit 6c4bfb3

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
RUST_BACKTRACE: 1
1717
RUSTFLAGS: -Dwarnings
1818
RUSTDOCFLAGS: -Dwarnings
19-
MSRV: "1.81"
19+
MSRV: "1.85"
2020
SCCACHE_CACHE_SIZE: "10G"
2121
IROH_FORCE_STAGING_RELAYS: "1"
2222

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ members = ["iroh-metrics-derive"]
44
[package]
55
name = "iroh-metrics"
66
version = "0.36.2"
7-
edition = "2021"
7+
edition = "2024"
88
readme = "README.md"
99
description = "metrics for iroh"
1010
license = "MIT OR Apache-2.0"
1111
authors = ["arqu <[email protected]>", "n0 team"]
1212
repository = "https://github.com/n0-computer/iroh-metrics"
1313

1414
# Sadly this also needs to be updated in .github/workflows/ci.yml
15-
rust-version = "1.81"
15+
rust-version = "1.85"
1616

1717
[lints.rust]
1818
missing_debug_implementations = "warn"

iroh-metrics-derive/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "iroh-metrics-derive"
33
version = "0.3.1"
4-
edition = "2021"
4+
edition = "2024"
55
description = "derive macros for iroh-metrics"
66
license = "MIT OR Apache-2.0"
77
authors = ["Frando <[email protected]>", "n0 team"]
88
repository = "https://github.com/n0-computer/iroh-metrics"
99

1010
# Sadly this also needs to be updated in .github/workflows/ci.yml
11-
rust-version = "1.81"
11+
rust-version = "1.85"
1212

1313
[lib]
1414
proc-macro = true

iroh-metrics-derive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use heck::ToSnakeCase;
22
use proc_macro::TokenStream;
33
use quote::quote;
44
use syn::{
5-
meta::ParseNestedMeta, parse_macro_input, spanned::Spanned, Attribute, Data, DeriveInput,
6-
Error, Expr, ExprLit, Fields, Ident, Lit, LitStr,
5+
Attribute, Data, DeriveInput, Error, Expr, ExprLit, Fields, Ident, Lit, LitStr,
6+
meta::ParseNestedMeta, parse_macro_input, spanned::Spanned,
77
};
88

99
#[proc_macro_derive(MetricsGroup, attributes(metrics, default))]

src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::{any::Any, sync::Arc};
22

33
use crate::{
4+
Metric, MetricType, MetricValue,
45
encoding::EncodableMetric,
56
iterable::{FieldIter, IntoIterable, Iterable},
6-
Metric, MetricType, MetricValue,
77
};
88

99
/// Trait for structs containing metric items.
@@ -120,9 +120,9 @@ mod tests {
120120

121121
use super::*;
122122
use crate::{
123+
Counter, Gauge, Histogram, MetricType, MetricsGroupSet, MetricsSource, Registry,
123124
encoding::{Decoder, Encoder},
124125
iterable::Iterable,
125-
Counter, Gauge, Histogram, MetricType, MetricsGroupSet, MetricsSource, Registry,
126126
};
127127

128128
#[derive(Debug, Iterable, Serialize, Deserialize)]

src/registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use std::{
55
fmt::{self, Write},
66
ops::Deref,
77
sync::{
8-
atomic::{AtomicU64, Ordering},
98
Arc, RwLock,
9+
atomic::{AtomicU64, Ordering},
1010
},
1111
};
1212

13-
use crate::{encoding::write_eof, Error, MetricsGroup, MetricsGroupSet};
13+
use crate::{Error, MetricsGroup, MetricsGroupSet, encoding::write_eof};
1414

1515
/// A registry for [`MetricsGroup`].
1616
#[derive(Debug, Default)]

src/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ use std::{
55
time::{Duration, Instant},
66
};
77

8-
use hyper::{service::service_fn, Request, Response};
8+
use hyper::{Request, Response, service::service_fn};
99
use tokio::{io::AsyncWriteExt as _, net::TcpListener};
1010
use tracing::{debug, error, info, warn};
1111

12-
use crate::{parse_prometheus_metrics, Error, MetricsSource};
12+
use crate::{Error, MetricsSource, parse_prometheus_metrics};
1313

1414
type BytesBody = http_body_util::Full<hyper::body::Bytes>;
1515

src/static_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! ```rust
1313
//! use std::sync::Arc;
1414
//!
15-
//! use iroh_metrics::{inc, inc_by, static_core::Core, Counter, MetricsGroup};
15+
//! use iroh_metrics::{Counter, MetricsGroup, inc, inc_by, static_core::Core};
1616
//!
1717
//! #[derive(Debug, Default, MetricsGroup)]
1818
//! #[metrics(name = "my_metrics")]

0 commit comments

Comments
 (0)