[PR #1763] [MERGED] Clean unwrap again #2588

Closed
opened 2026-03-16 10:43:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1763
Author: @darnuria
Created: 8/11/2022
Status: Merged
Merged: 8/15/2022
Merged by: @bluejekyll

Base: mainHead: clean-unwrap-again


📝 Commits (7)

  • 0260af6 named::load_zone use ? instead of unwrap in logs.
  • 056c99c Change get_listen_addrs_ipv4/6 to Return result instead of unwrap.
  • 04d8ec6 DNSSEC: use ? where possible
  • 27c1a54 ClientStreamXfrState::process avoid an unwrap call
  • 93fe3e8 Sprinkle expect in tcp_server_setup instead of unwrap.
  • e0abc65 FileAuthority::read_file avoid unwrap do a map_err.
  • 14c5d4b Journal::from_file: use try to rewrite a match.

📊 Changes

9 files changed (+34 additions, -45 deletions)

View changed files

📝 bin/src/named.rs (+8 -7)
📝 crates/client/src/client/async_client.rs (+4 -7)
📝 crates/client/src/rr/dnssec/keypair.rs (+2 -2)
📝 crates/proto/src/rr/dnssec/public_key.rs (+1 -1)
📝 crates/proto/src/tests/tcp.rs (+3 -2)
📝 crates/server/src/config/mod.rs (+5 -11)
📝 crates/server/src/store/file/authority.rs (+1 -1)
📝 crates/server/src/store/sqlite/persistence.rs (+3 -7)
📝 crates/server/tests/config_tests.rs (+7 -7)

📄 Description

An other pull request who try to remove unwraps calls.

If any commit is better to be dropped tell me! On to roll-up if needed.
I chose to remove some unwrap who are "not possible" rustc can know it and lift the ? branch (because where is a size check) and it's future proof and fool prof.

May check cargo asm of the function to check my statement in a comment later.


🔄 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/1763 **Author:** [@darnuria](https://github.com/darnuria) **Created:** 8/11/2022 **Status:** ✅ Merged **Merged:** 8/15/2022 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `clean-unwrap-again` --- ### 📝 Commits (7) - [`0260af6`](https://github.com/hickory-dns/hickory-dns/commit/0260af6e1080fa8e19762be5ee5e648bd8a23205) named::load_zone use ? instead of unwrap in logs. - [`056c99c`](https://github.com/hickory-dns/hickory-dns/commit/056c99cfbc3cb3bbc3015cb21bd4afad3aed304f) Change get_listen_addrs_ipv4/6 to Return result instead of unwrap. - [`04d8ec6`](https://github.com/hickory-dns/hickory-dns/commit/04d8ec6d0bcae2ad5ab7da9b00fbc842934037a9) DNSSEC: use ? where possible - [`27c1a54`](https://github.com/hickory-dns/hickory-dns/commit/27c1a54e0b9b3172b966f62259227256b6f23a22) ClientStreamXfrState::process avoid an unwrap call - [`93fe3e8`](https://github.com/hickory-dns/hickory-dns/commit/93fe3e88918bef2233ed0ce2515669c5db96b15b) Sprinkle expect in tcp_server_setup instead of unwrap. - [`e0abc65`](https://github.com/hickory-dns/hickory-dns/commit/e0abc65200eb24f667a1dec63fd64511535b7ce6) FileAuthority::read_file avoid unwrap do a map_err. - [`14c5d4b`](https://github.com/hickory-dns/hickory-dns/commit/14c5d4b0b857a52ba4b141f7aee5be9897b13816) Journal::from_file: use try to rewrite a match. ### 📊 Changes **9 files changed** (+34 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `bin/src/named.rs` (+8 -7) 📝 `crates/client/src/client/async_client.rs` (+4 -7) 📝 `crates/client/src/rr/dnssec/keypair.rs` (+2 -2) 📝 `crates/proto/src/rr/dnssec/public_key.rs` (+1 -1) 📝 `crates/proto/src/tests/tcp.rs` (+3 -2) 📝 `crates/server/src/config/mod.rs` (+5 -11) 📝 `crates/server/src/store/file/authority.rs` (+1 -1) 📝 `crates/server/src/store/sqlite/persistence.rs` (+3 -7) 📝 `crates/server/tests/config_tests.rs` (+7 -7) </details> ### 📄 Description An other pull request who try to remove `unwraps calls`. If any commit is better to be dropped tell me! On to roll-up if needed. I chose to remove some unwrap who are "not possible" rustc can know it and lift the `?` branch (because where is a size check) and it's future proof and fool prof. May check cargo asm of the function to check my statement in a comment later. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 10:43:18 +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#2588
No description provided.