1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-10-01 16:54:08 +02:00

clippy fixes

This commit is contained in:
Robin Appelman 2026-08-17 19:04:46 +02:00
commit b1b4ac3ce9
6 changed files with 15 additions and 23 deletions

View file

@ -10,13 +10,11 @@ pub async fn clear_networks(docker: &Docker, instances: &[Cloud]) -> Result<()>
.into_diagnostic()
.wrap_err("Failed to list docker networks")?;
for network in networks {
if let Some(name) = network.name.as_deref() {
if let Some(id) = name.strip_prefix("haze-") {
if !instances.iter().any(|cloud| cloud.id == id) {
if let Some(name) = network.name.as_deref()
&& let Some(id) = name.strip_prefix("haze-")
&& !instances.iter().any(|cloud| cloud.id == id) {
docker.remove_network(name).await.ok();
}
}
}
}
Ok(())
}