Skip to content

Commit

Permalink
Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed May 7, 2023
1 parent 48c25b5 commit ef57fe4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ byteorder = "1"
chomp = { package = "chomp1", version = "0.3" }
hex = "0.4"
libc = "0.2"
libloading = { version = "0.7", optional = true }
libloading = { version = "0.8", optional = true }
rand = "0.8"
thiserror = "1"

Expand Down
2 changes: 1 addition & 1 deletion src/parsed_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl ParsedPacket {
let uncompressed = Compress::uncompress(self.packet())?;
self.packet = Some(uncompressed);
self.recompute()?;
debug_assert_eq!(self.maybe_compressed, false);
debug_assert!(!self.maybe_compressed);
}
let rr_len = rr.packet.len();
if DNS_MAX_UNCOMPRESSED_SIZE - self.packet().len() < rr_len {
Expand Down
4 changes: 2 additions & 2 deletions src/rr_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub trait TypedIterable {
packet.resize(new_packet_len, 0);
debug_assert_eq!(
new_packet_len,
(offset as isize + shift) as usize + (packet_len - offset) as usize
(offset as isize + shift) as usize + (packet_len - offset)
);
packet.copy_within(offset..offset + packet_len, offset + shift as usize);
} else if shift < 0 {
Expand Down Expand Up @@ -267,7 +267,7 @@ pub trait TypedIterable {
self.recompute_sections();
}
let offset = self.offset().ok_or(DSError::VoidRecord)?;
debug_assert_eq!(self.parsed_packet().maybe_compressed, false);
debug_assert!(!self.parsed_packet().maybe_compressed);
let current_name_len = Compress::raw_name_len(self.name_slice());
let shift = new_name_len as isize - current_name_len as isize;
self.resize_rr(shift)?;
Expand Down

0 comments on commit ef57fe4

Please sign in to comment.