[GH-ISSUE #92] Cleaner header construction with the field_init_shorthand feature #48

Closed
opened 2026-03-07 22:18:19 +03:00 by kerem · 5 comments
Owner

Originally created by @Kerollmops on GitHub (Feb 17, 2017).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/92

github.com/bluejekyll/trust-dns@2b705dc300/client/src/op/header.rs (L289-L298)

The field_init_shorthand unstable feature can probably help you get a cleaner header construction.

Originally created by @Kerollmops on GitHub (Feb 17, 2017). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/92 https://github.com/bluejekyll/trust-dns/blob/2b705dc3001c369cd75446996cc10c8f673a35c1/client/src/op/header.rs#L289-L298 The [`field_init_shorthand` unstable feature](https://github.com/rust-lang/rust/issues/37340) can probably help you get a cleaner header construction.
kerem 2026-03-07 22:18:19 +03:00
  • closed this issue
  • added the
    cleanup
    label
Author
Owner

@Kerollmops commented on GitHub (Feb 17, 2017):

Ho ! Sorry, you want only stable Rust. We will probably wait this feature to be added into stable releases.

<!-- gh-comment-id:280514009 --> @Kerollmops commented on GitHub (Feb 17, 2017): Ho ! Sorry, you want only stable Rust. We will probably wait this feature to be added into stable releases.
Author
Owner

@bluejekyll commented on GitHub (Feb 17, 2017):

Yes, and that's some of my oldest Rust code. Could definitely use some touch ups...

<!-- gh-comment-id:280717623 --> @bluejekyll commented on GitHub (Feb 17, 2017): Yes, and that's some of my oldest Rust code. Could definitely use some touch ups...
Author
Owner

@briansmith commented on GitHub (Apr 27, 2017):

Rust 1.17 was released and it supports the field init shortcut syntax now.

BTW, I saw the comment in the code about using the builder pattern. I agree that the current, non-builder, way is better.

<!-- gh-comment-id:297864626 --> @briansmith commented on GitHub (Apr 27, 2017): Rust 1.17 was released and it supports the field init shortcut syntax now. BTW, I saw the comment in the code about using the builder pattern. I agree that the current, non-builder, way is better.
Author
Owner

@bluejekyll commented on GitHub (Apr 27, 2017):

Yeah, I just saw that today. That will be really nice. If anyone wants to submit a PR for this, that would be great. Otherwise, I'll start cleaning some of this up as I come across it.

<!-- gh-comment-id:297868627 --> @bluejekyll commented on GitHub (Apr 27, 2017): Yeah, I just saw that today. That will be really nice. If anyone wants to submit a PR for this, that would be great. Otherwise, I'll start cleaning some of this up as I come across it.
Author
Owner

@bluejekyll commented on GitHub (Aug 24, 2017):

fixed in #179

<!-- gh-comment-id:324531020 --> @bluejekyll commented on GitHub (Aug 24, 2017): fixed in #179
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#48
No description provided.