Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaner header construction with the field_init_shorthand feature #92

Closed
Kerollmops opened this issue Feb 17, 2017 · 5 comments
Closed
Labels

Comments

@Kerollmops
Copy link

Kerollmops commented Feb 17, 2017

https://github.com/bluejekyll/trust-dns/blob/2b705dc3001c369cd75446996cc10c8f673a35c1/client/src/op/header.rs#L289-L298

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

@Kerollmops
Copy link
Author

Kerollmops commented Feb 17, 2017

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

@bluejekyll
Copy link
Member

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

@briansmith
Copy link
Contributor

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.

@bluejekyll
Copy link
Member

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.

@bluejekyll
Copy link
Member

fixed in #179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants