Skip to content

Commit

Permalink
use bitstring 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
stbuehler committed Sep 30, 2024
1 parent 9629dec commit 4ffa384
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bitstring = ["dep:bitstring"]
serde = ["dep:serde"]

[dependencies]
bitstring = { version = "0.1.0", optional = true }
bitstring = { version = "0.2.0", optional = true, features = ["net"] }
serde = { version = "1.0.27", optional = true }

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion src/cidr/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ macro_rules! impl_cidr_for {

fn shared_prefix_len(&self, other: &Self) -> usize {
let max_len = core::cmp::min(self.network_length, other.network_length) as usize;
FixedBitString::shared_prefix_len(&self.address, &other.address, max_len)
core::cmp::min(
FixedBitString::shared_prefix_len(&self.address, &other.address),
max_len,
)
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/inet/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ macro_rules! impl_inet_for {

fn shared_prefix_len(&self, other: &Self) -> usize {
let max_len = core::cmp::min(self.network_length, other.network_length) as usize;
FixedBitString::shared_prefix_len(&self.address, &other.address, max_len)
core::cmp::min(
FixedBitString::shared_prefix_len(&self.address, &other.address),
max_len,
)
}
}

Expand Down

0 comments on commit 4ffa384

Please sign in to comment.