Skip to content

Commit 4eb69dc

Browse files
committed
chore: reformat if-let chains
Reformat the codebase now that rustfmt supports if-let chains (yay!). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
1 parent 65c3858 commit 4eb69dc

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

holo-bfd/src/session.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,8 @@ impl Session {
371371
{
372372
// (Re)start Tx interval.
373373
let sockaddr = self.state.sockaddr.unwrap();
374-
let task = tasks::udp_tx_interval(
375-
self, interval, socket_tx, sockaddr
376-
);
374+
let task =
375+
tasks::udp_tx_interval(self, interval, socket_tx, sockaddr);
377376
self.state.tx_interval = Some(task);
378377
} else {
379378
// Stop Tx interval.

holo-ospf/src/ospfv3/packet/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ impl PacketVersion<Self> for Ospfv3 {
798798
// structures, which would require the introduction of locking
799799
// primitives.
800800
if let Some(options) = options
801-
&& auth.is_some() != options.contains(Options::AT) {
801+
&& auth.is_some() != options.contains(Options::AT)
802+
{
802803
return Err(DecodeError::AuthTypeMismatch);
803804
}
804805
if auth.is_none() {
@@ -810,14 +811,15 @@ impl PacketVersion<Self> for Ospfv3 {
810811

811812
// Ignore optional LLS block (only present in Hello and Database
812813
// Description packets).
813-
if let Some(options) = &options && options.contains(Options::L) {
814+
if let Some(options) = &options
815+
&& options.contains(Options::L)
816+
{
814817
if buf.remaining() < LLS_HDR_SIZE as usize {
815818
return Err(DecodeError::InvalidLength(buf.len() as u16));
816819
}
817820
let _lls_cksum = buf.get_u16();
818821
let lls_block_len = buf.get_u16();
819-
if buf.remaining() < (lls_block_len * 4 - LLS_HDR_SIZE) as usize
820-
{
822+
if buf.remaining() < (lls_block_len * 4 - LLS_HDR_SIZE) as usize {
821823
return Err(DecodeError::InvalidLength(buf.len() as u16));
822824
}
823825
buf.advance(lls_block_len as usize);

0 commit comments

Comments
 (0)