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

Add mutable access to Message fields #1118

Merged
merged 3 commits into from May 20, 2020
Merged

Conversation

leshow
Copy link
Contributor

@leshow leshow commented May 19, 2020

closes: #1117

@codecov
Copy link

codecov bot commented May 19, 2020

Codecov Report

Merging #1118 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1118   +/-   ##
=======================================
  Coverage   85.00%   85.00%           
=======================================
  Files         125      125           
  Lines       13377    13377           
=======================================
  Hits        11370    11370           
  Misses       2007     2007           

@leshow
Copy link
Contributor Author

leshow commented May 19, 2020

I left the return type as &mut Vec, but a mutable slice is also an option, let me know if you have a preference.

@bluejekyll
Copy link
Member

bluejekyll commented May 19, 2020

If you want to be able to insert new Records into the answers or other sections, then I think it needs to be a &mut Vec, right? Otherwise you would be limited to changing existing entries, right?

@leshow
Copy link
Contributor Author

leshow commented May 19, 2020

The particular use case was modifying existing Records in answers, so either type would work for me. I've left it as &mut Vec though which is the most "open" option, if you're okay with that change.

@bluejekyll
Copy link
Member

The only concern to think about is that we are exposing the internal data structure of the Message. I think I'm ok with this, but I want to think about it for a little bit.

@bluejekyll
Copy link
Member

Ok, let's merge this, as-is, can always revisit in the future.

@bluejekyll
Copy link
Member

Thanks for the PR!

@bluejekyll bluejekyll merged commit 5bd074b into hickory-dns:master May 20, 2020
@leshow
Copy link
Contributor Author

leshow commented May 20, 2020

Thank you!

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

Successfully merging this pull request may close these issues.

Mutable access to Message members
2 participants