mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
refactor(connlib): reduce indentation when looping over gateways (#5944)
By leveraging `let-else`, we can perform the main action - pushing to the buffered transmits - on first indentation level of the loop.
This commit is contained in:
@@ -379,10 +379,12 @@ impl TunnelTest {
|
||||
});
|
||||
|
||||
for (_, gateway) in self.gateways.iter_mut() {
|
||||
if let Some(transmit) = gateway.exec_mut(|g| g.sut.poll_transmit()) {
|
||||
buffered_transmits.push(transmit, gateway);
|
||||
continue 'outer;
|
||||
}
|
||||
let Some(transmit) = gateway.exec_mut(|g| g.sut.poll_transmit()) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
buffered_transmits.push(transmit, gateway);
|
||||
continue 'outer;
|
||||
}
|
||||
|
||||
for (id, gateway) in self.gateways.iter_mut() {
|
||||
|
||||
Reference in New Issue
Block a user