Skip to content

Commit

Permalink
chore: fix new clippy warnings on nightly
Browse files Browse the repository at this point in the history
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
  • Loading branch information
rwestphal committed Jan 31, 2025
1 parent a8a275b commit 88818f1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion holo-bgp/src/packet/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,5 +1061,5 @@ pub(crate) fn decode_ipv6_prefix(

// Calculates the number of bytes required to encode a prefix.
fn prefix_wire_len(len: u8) -> usize {
(len as usize + 7) / 8
(len as usize).div_ceil(8)
}
2 changes: 1 addition & 1 deletion holo-isis/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl Interface {
}

pub(crate) fn is_dis(&self, level: LevelNumber) -> bool {
self.state.dis.get(level).map_or(false, |dis| dis.myself)
self.state.dis.get(level).is_some_and(|dis| dis.myself)
}

pub(crate) fn dis_start(&mut self, instance: &mut InstanceUpView<'_>) {
Expand Down
2 changes: 1 addition & 1 deletion holo-isis/src/packet/tlv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ impl<T: MultiTlv> Tlv for T {

// Calculates the number of bytes required to encode a prefix.
const fn prefix_wire_len(len: u8) -> usize {
(len as usize + 7) / 8
(len as usize).div_ceil(8)
}

fn tlv_encode_start(buf: &mut BytesMut, tlv_type: impl ToPrimitive) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion holo-ldp/src/packet/messages/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,5 +644,5 @@ impl TlvKind for TlvLabelRequestId {

// Calculate the number of bytes required to encode a prefix.
fn prefix_wire_len(len: u8) -> usize {
(len as usize + 7) / 8
(len as usize).div_ceil(8)
}
2 changes: 1 addition & 1 deletion holo-ospf/src/ospfv3/packet/lsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2880,7 +2880,7 @@ impl LsaVersion<Self> for Ospfv3 {

// Calculate the number of bytes required to encode a prefix.
fn prefix_wire_len(len: u8) -> usize {
((len as usize + 31) / 32) * 4
(len as usize).div_ceil(32) * 4
}

fn decode_16bit_addr(af: AddressFamily, buf: &mut Bytes) -> IpAddr {
Expand Down

0 comments on commit 88818f1

Please sign in to comment.