Skip to content

Commit 5a168f5

Browse files
committed
Collapse if statements per rustfmt
1 parent 38f0a01 commit 5a168f5

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/lib.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,15 @@ pub async fn reap_containers(
312312
.clone(),
313313
status: RemovalStatus::Eligible,
314314
});
315-
if config.reap_networks {
316-
if let Some(network_settings) = container.network_settings {
317-
if let Some(networks) = network_settings.networks {
318-
// Docker has network IDs, but also requires each network to have a unique
319-
// name. We just use the name as an ID since it's easier to retrieve.
320-
eligible_network_names.extend(networks.keys().cloned().inspect(|name| {
321-
debug!("Added network {} from container {} ", name, id);
322-
}))
323-
}
324-
}
315+
if config.reap_networks
316+
&& let Some(network_settings) = container.network_settings
317+
&& let Some(networks) = network_settings.networks
318+
{
319+
// Docker has network IDs, but also requires each network to have a unique
320+
// name. We just use the name as an ID since it's easier to retrieve.
321+
eligible_network_names.extend(networks.keys().cloned().inspect(|name| {
322+
debug!("Added network {} from container {} ", name, id);
323+
}))
325324
}
326325
}
327326
for network_name in eligible_network_names {

0 commit comments

Comments
 (0)