[PR #1944] [MERGED] Replace lazy_static with once_cell #2711

Closed
opened 2026-03-16 11:04:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1944
Author: @daxpedda
Created: 5/24/2023
Status: Merged
Merged: 5/24/2023
Merged by: @djc

Base: mainHead: once-cell


📝 Commits (1)

  • c574380 Replace lazy_static with once_cell

📊 Changes

16 files changed (+504 additions, -334 deletions)

View changed files

📝 Cargo.lock (+4 -4)
📝 Cargo.toml (+1 -1)
📝 crates/client/Cargo.toml (+1 -1)
📝 crates/client/src/rr/zone.rs (+200 -66)
📝 crates/proto/Cargo.toml (+1 -1)
📝 crates/proto/src/error.rs (+7 -9)
📝 crates/proto/src/multicast/mdns_stream.rs (+16 -13)
📝 crates/proto/src/rr/domain/usage.rs (+162 -119)
📝 crates/proto/src/rr/rdata/sshfp.rs (+10 -12)
📝 crates/resolver/Cargo.toml (+1 -1)
📝 crates/resolver/examples/global_resolver.rs (+66 -66)
📝 crates/resolver/src/caching_client.rs (+5 -5)
📝 crates/resolver/src/lib.rs (+0 -2)
📝 crates/resolver/src/tls/dns_over_rustls.rs (+23 -24)
📝 tests/integration-tests/Cargo.toml (+1 -1)
📝 tests/integration-tests/tests/mdns_tests.rs (+6 -9)

📄 Description

This replaces the current dependency on lazy_static with once_cell. Couple of reasons:


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1944 **Author:** [@daxpedda](https://github.com/daxpedda) **Created:** 5/24/2023 **Status:** ✅ Merged **Merged:** 5/24/2023 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `once-cell` --- ### 📝 Commits (1) - [`c574380`](https://github.com/hickory-dns/hickory-dns/commit/c574380cd5012dc90c016609647a6de1b9d3cce2) Replace `lazy_static` with `once_cell` ### 📊 Changes **16 files changed** (+504 additions, -334 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+4 -4) 📝 `Cargo.toml` (+1 -1) 📝 `crates/client/Cargo.toml` (+1 -1) 📝 `crates/client/src/rr/zone.rs` (+200 -66) 📝 `crates/proto/Cargo.toml` (+1 -1) 📝 `crates/proto/src/error.rs` (+7 -9) 📝 `crates/proto/src/multicast/mdns_stream.rs` (+16 -13) 📝 `crates/proto/src/rr/domain/usage.rs` (+162 -119) 📝 `crates/proto/src/rr/rdata/sshfp.rs` (+10 -12) 📝 `crates/resolver/Cargo.toml` (+1 -1) 📝 `crates/resolver/examples/global_resolver.rs` (+66 -66) 📝 `crates/resolver/src/caching_client.rs` (+5 -5) 📝 `crates/resolver/src/lib.rs` (+0 -2) 📝 `crates/resolver/src/tls/dns_over_rustls.rs` (+23 -24) 📝 `tests/integration-tests/Cargo.toml` (+1 -1) 📝 `tests/integration-tests/tests/mdns_tests.rs` (+6 -9) </details> ### 📄 Description This replaces the current dependency on [`lazy_static`](https://crates.io/crates/lazy_static) with [`once_cell`](https://crates.io/crates/once_cell). Couple of reasons: - The ecosystem in general is shifting away from `lazy_static` to `once_cell`, so hopefully one day we can eliminate `lazy_static` from the dependency tree. - `lazy_static` is unmaintained. - `once_cell` is much closer to whats going to be [stabilized in Rust v1.70](https://github.com/rust-lang/rust/pull/105587) and [future](https://github.com/rust-lang/rust/issues/109736) [versions](https://github.com/rust-lang/rust/issues/109737): https://github.com/rust-lang/rust/issues/74465. - `once_cell` will also give us the `OnceCell` type, which allows for failing initialization, as required in #1943. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:04:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2711
No description provided.