Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ewpratten committed Aug 4, 2023
1 parent 23fd3f2 commit 2486aac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions libs/fast-nat/src/cpnat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ impl CrossProtocolNetworkAddressTableWithIpv4Pool {
let new_address = self
.pool
.iter()
.map(|prefix| prefix.hosts())
.flatten()
.find(|addr| !self.table.get_ipv6(addr).is_some())
.flat_map(Ipv4Net::hosts)
.find(|addr| self.table.get_ipv6(addr).is_none())
.ok_or(Error::Ipv4PoolExhausted)?;

// Insert the new mapping
Expand Down
4 changes: 2 additions & 2 deletions src/protomask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub async fn main() {
Some(new_destination) => Ok(translate_ipv4_to_ipv6(
packet,
unsafe { embed_ipv4_addr_unchecked(*source, args.translation_prefix) },
new_destination.into(),
new_destination,
)
.map(Some)?),
None => {
Expand All @@ -183,7 +183,7 @@ pub async fn main() {
|packet, source, dest| {
Ok(translate_ipv6_to_ipv4(
packet,
addr_table.borrow_mut().get_or_create_ipv4(source)?.into(),
addr_table.borrow_mut().get_or_create_ipv4(source)?,
unsafe {
extract_ipv4_addr_unchecked(*dest, args.translation_prefix.prefix_len())
},
Expand Down

2 comments on commit 2486aac

@github-actions
Copy link

Choose a reason for hiding this comment

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

Binary sizes for aarch64-unknown-linux-musl

Channel: stable

9.5M	target/aarch64-unknown-linux-musl/release/protomask
9.4M	target/aarch64-unknown-linux-musl/release/protomask-clat
5.0M	target/aarch64-unknown-linux-musl/release/protomask-6over4

@github-actions
Copy link

Choose a reason for hiding this comment

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

Binary sizes for x86_64-unknown-linux-musl

Channel: stable

9.2M	target/x86_64-unknown-linux-musl/release/protomask-clat
9.2M	target/x86_64-unknown-linux-musl/release/protomask
4.8M	target/x86_64-unknown-linux-musl/release/protomask-6over4

Please sign in to comment.