Skip to content

Commit 79bc05b

Browse files
authored
chore(*): upgrade to the latest iroh-metrics, portmapper, and swarm-discovery (#3369)
## Description Upgrade to the latest `iroh-metrics`, `portmapper`, and `swarm-discovery`. We can finally remove our `anyhow` direct dependency! Lots of clippy changes because of a clippy update. ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review.
1 parent 6e72f20 commit 79bc05b

File tree

27 files changed

+70
-81
lines changed

27 files changed

+70
-81
lines changed

Cargo.lock

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

iroh-dns-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ hickory-server = { version = "0.25.1", features = ["https-ring"] }
2828
http = "1.0.0"
2929
humantime = "2.2.0"
3030
humantime-serde = "1.1.1"
31-
iroh-metrics = { version = "0.34", features = ["service"] }
31+
iroh-metrics = { version = "0.35", features = ["service"] }
3232
lru = "0.13"
3333
n0-future = "0.1.2"
3434
n0-snafu = "0.2.0"

iroh-dns-server/examples/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn main() -> Result<()> {
2727
Command::PkarrToNode { z32_pubkey } => {
2828
let public_key = pkarr::PublicKey::try_from(z32_pubkey.as_str()).e()?;
2929
let node_id = NodeId::from_bytes(public_key.as_bytes()).e()?;
30-
println!("{}", node_id)
30+
println!("{node_id}")
3131
}
3232
}
3333
Ok(())

iroh-dns-server/examples/publish.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,21 @@ async fn main() -> Result<()> {
116116

117117
match args.env {
118118
Env::Staging => {
119-
println!(
120-
" cargo run --example resolve -- --env staging node {}",
121-
node_id
122-
);
119+
println!(" cargo run --example resolve -- --env staging node {node_id}");
123120
println!(
124121
" dig {} TXT",
125122
fmt_domain(&node_id, N0_DNS_NODE_ORIGIN_STAGING)
126123
)
127124
}
128125
Env::Prod => {
129-
println!(
130-
" cargo run --example resolve -- --env prod node {}",
131-
node_id
132-
);
126+
println!(" cargo run --example resolve -- --env prod node {node_id}");
133127
println!(
134128
" dig {} TXT",
135129
fmt_domain(&node_id, N0_DNS_NODE_ORIGIN_PROD)
136130
)
137131
}
138132
Env::Dev => {
139-
println!(
140-
" cargo run --example resolve -- --env dev node {}",
141-
node_id
142-
);
133+
println!(" cargo run --example resolve -- --env dev node {node_id}");
143134
println!(
144135
" dig @localhost -p 5300 {} TXT",
145136
fmt_domain(&node_id, DEV_DNS_ORIGIN_DOMAIN)
@@ -150,5 +141,5 @@ async fn main() -> Result<()> {
150141
}
151142

152143
fn fmt_domain(node_id: &NodeId, origin: &str) -> String {
153-
format!("{}.{}.{}", IROH_TXT_NAME, node_id.to_z32(), origin)
144+
format!("{IROH_TXT_NAME}.{}.{origin}", node_id.to_z32())
154145
}

iroh-dns-server/src/dns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn create_static_authority(
270270
}
271271

272272
let static_authority = InMemoryAuthority::new(Name::root(), records, ZoneType::Primary, false)
273-
.map_err(|e| format_err!("new authority: {}", e))?;
273+
.map_err(|e| format_err!("new authority: {e}"))?;
274274

275275
Ok((static_authority, serial))
276276
}

iroh-dns-server/src/http/doh/extract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ fn decode_request(bytes: &[u8], src_addr: SocketAddr) -> Result<DNSRequest, AppE
257257
}
258258
Err(err) => Err(AppError::new(
259259
StatusCode::BAD_REQUEST,
260-
Some(format!("Invalid DNS message: {}", err)),
260+
Some(format!("Invalid DNS message: {err}")),
261261
)),
262262
}
263263
}

iroh-relay/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ http-body-util = "0.1.0"
3232
hyper = { version = "1", features = ["server", "client", "http1"] }
3333
hyper-util = "0.1.1"
3434
iroh-base = { version = "0.35.0", path = "../iroh-base", default-features = false, features = ["key", "relay"] }
35-
iroh-metrics = { version = "0.34", default-features = false }
35+
iroh-metrics = { version = "0.35", default-features = false }
3636
n0-future = "0.1.2"
3737
num_enum = "0.7"
3838
pin-project = "1"

iroh-relay/src/client/tls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl MaybeTlsStreamBuilder {
228228

229229
// Establish Proxy Tunnel
230230
let mut req_builder = Request::builder()
231-
.uri(format!("{}:{}", target_host, port))
231+
.uri(format!("{target_host}:{port}"))
232232
.method("CONNECT")
233233
.header("Host", target_host)
234234
.header("Proxy-Connection", "Keep-Alive");
@@ -245,7 +245,7 @@ impl MaybeTlsStreamBuilder {
245245
proxy_url.password().unwrap_or_default()
246246
);
247247
let encoded = BASE64URL.encode(to_encode.as_bytes());
248-
req_builder = req_builder.header("Proxy-Authorization", format!("Basic {}", encoded));
248+
req_builder = req_builder.header("Proxy-Authorization", format!("Basic {encoded}"));
249249
}
250250
let req = req_builder
251251
.body(Empty::<Bytes>::new())

iroh-relay/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ async fn maybe_load_tls(
586586
.clone()
587587
.context("LetsEncrypt needs a contact email")?;
588588
let config = AcmeConfig::new(vec![hostname.clone()])
589-
.contact([format!("mailto:{}", contact)])
589+
.contact([format!("mailto:{contact}")])
590590
.cache_option(Some(DirCache::new(tls.cert_dir())))
591591
.directory_lets_encrypt(tls.prod_tls);
592592
let state = config.state();

iroh-relay/src/node_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ fn ensure_iroh_txt_label(name: Name) -> Result<Name, LookupError> {
730730

731731
#[cfg(not(wasm_browser))]
732732
fn node_domain(node_id: &NodeId, origin: &str) -> Result<Name, LookupError> {
733-
let domain = format!("{}.{}", NodeId::to_z32(node_id), origin);
733+
let domain = format!("{}.{origin}", NodeId::to_z32(node_id));
734734
let domain = Name::from_str(&domain).context(InvalidLabelSnafu)?;
735735
Ok(domain)
736736
}

0 commit comments

Comments
 (0)