Skip to content

Commit

Permalink
Change Edns set_* to -> &mut Self
Browse files Browse the repository at this point in the history
  • Loading branch information
leshow authored and bluejekyll committed Jan 28, 2021
1 parent 85edab7 commit 6b2ed70
Showing 1 changed file with 11 additions and 7 deletions.
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

0 comments on commit 6b2ed70

Please sign in to comment.