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

Change Edns set_* to -> &mut Self #1369

Merged
merged 1 commit into from Jan 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions crates/proto/src/op/edns.rs
Expand Up @@ -94,24 +94,28 @@ impl Edns {
}

/// Set the high order bits for the result code.
pub fn set_rcode_high(&mut self, rcode_high: u8) {
self.rcode_high = rcode_high
pub fn set_rcode_high(&mut self, rcode_high: u8) -> &mut Self {
self.rcode_high = rcode_high;
self
}

/// Set the EDNS version
pub fn set_version(&mut self, version: u8) {
self.version = version
pub fn set_version(&mut self, version: u8) -> &mut Self {
self.version = version;
self
}

/// Set to true if DNSSec is supported
pub fn set_dnssec_ok(&mut self, dnssec_ok: bool) {
self.dnssec_ok = dnssec_ok
pub fn set_dnssec_ok(&mut self, dnssec_ok: bool) -> &mut Self {
self.dnssec_ok = dnssec_ok;
self
}

/// Set the maximum payload which can be supported
/// From RFC 6891: `Values lower than 512 MUST be treated as equal to 512`
pub fn set_max_payload(&mut self, max_payload: u16) {
pub fn set_max_payload(&mut self, max_payload: u16) -> &mut Self {
self.max_payload = max_payload.max(512);
self
}

/// Set the specified EDNS option
Expand Down