[GH-ISSUE #1445] Replace all min & max constructs with clamp #675

Closed
opened 2026-03-15 23:46:55 +03:00 by kerem · 1 comment
Owner

Originally created by @bluejekyll on GitHub (Apr 9, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1445

This is a code cleanup. There are a lot of places in the code where min and max are applied to values to ensure they are between to valid min and max values. In Rust 1.50, clamp was introduced, this would be an improvement: https://doc.rust-lang.org/std/cmp/trait.Ord.html#method.clamp

Originally created by @bluejekyll on GitHub (Apr 9, 2021). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1445 This is a code cleanup. There are a lot of places in the code where min and max are applied to values to ensure they are between to valid min and max values. In Rust 1.50, clamp was introduced, this would be an improvement: https://doc.rust-lang.org/std/cmp/trait.Ord.html#method.clamp
kerem 2026-03-15 23:46:55 +03:00
Author
Owner

@chrismiceli commented on GitHub (Apr 30, 2021):

My attempt to resolve this issue is available for review https://github.com/bluejekyll/trust-dns/pull/1473

<!-- gh-comment-id:829761317 --> @chrismiceli commented on GitHub (Apr 30, 2021): My attempt to resolve this issue is available for review https://github.com/bluejekyll/trust-dns/pull/1473
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#675
No description provided.