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

Mutate edns & remove edns options #1363

Merged
merged 4 commits into from Jan 21, 2021
Merged

Mutate edns & remove edns options #1363

merged 4 commits into from Jan 21, 2021

Conversation

leshow
Copy link
Contributor

@leshow leshow commented Jan 20, 2021

closes #1362

@leshow leshow force-pushed the mutate_edns branch 2 times, most recently from 1264b06 to 11569bb Compare January 20, 2021 21:07
Copy link
Collaborator

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly seems reasonable, see nit below.

Do you actually need the serde upgrade? If not, please remove it from your branch.

Comment on lines 121 to 125

/// Remove the option specified by the `EdnsCode`
pub fn remove_option(&mut self, option: EdnsCode) {
self.options.remove(option);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you actually have a use case for this? It seems redundant with options_mut(), and I think I'd personally prefer only to expose options_mut() instead of having both.

Copy link
Contributor Author

@leshow leshow Jan 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wanted to get your take on this actually. It is redundant, but so is set_option once we have options_mut. The only reason I added remove_ was so there was some symmetry in the API.

It doesn't matter to me either way though, as long as there's some way to accomplish a removal.

edit: If we do with options_mut would you want to leave a #[deprecated] on set_options? Or just leave the method there?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, adding #[deprecated] on set_option() sounds like a plan to me.

@djc
Copy link
Collaborator

djc commented Jan 20, 2021

(Also please rebase on current main.)

@leshow leshow force-pushed the mutate_edns branch 2 times, most recently from 8811329 to e4ad3dd Compare January 20, 2021 21:38
@leshow
Copy link
Contributor Author

leshow commented Jan 20, 2021

Blah sorry, I kept pushing with a few typos. There it should all be fine now.

@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #1363 (bd74dfd) into main (06e4579) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1363      +/-   ##
==========================================
+ Coverage   86.29%   86.30%   +0.01%     
==========================================
  Files         132      132              
  Lines       13775    13788      +13     
==========================================
+ Hits        11886    11899      +13     
  Misses       1889     1889              

@bluejekyll
Copy link
Member

Looks like some #[allow(deprecated)] is going to be needed if we do deprecate that set_option method. I'm fine with that (or updating the existing use cases instead).

@djc djc merged commit c3c4666 into hickory-dns:main Jan 21, 2021
@djc
Copy link
Collaborator

djc commented Jan 21, 2021

Thanks!

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.

Ability to mutate Edns options
3 participants