summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-01 09:25:13 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-01 09:25:13 +0200
commit92c527b61043e37320c2cdf1b46ea96e44ce49f9 (patch)
tree0a6e365d4a48fdf40787059acee1d9f76ed366f1
parentbfa369b3d66f43ad39c8f3ad6e1c1ccd8b34ffcf (diff)
downloadvmadm-92c527b61043e37320c2cdf1b46ea96e44ce49f9.tar.gz
fix: simplify checking for success
-rw-r--r--src/bin/vmadm.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bin/vmadm.rs b/src/bin/vmadm.rs
index 75e0cdf..a2717ee 100644
--- a/src/bin/vmadm.rs
+++ b/src/bin/vmadm.rs
@@ -88,9 +88,8 @@ fn new(spec: &Path) -> anyhow::Result<()> {
fn wait_for_port(name: &str, port: i32) -> anyhow::Result<()> {
let addr = format!("{}:{}", name, port);
loop {
- match TcpStream::connect(&addr) {
- Ok(_) => return Ok(()),
- Err(_) => (),
+ if TcpStream::connect(&addr).is_ok() {
+ return Ok(());
}
}
}
@@ -150,7 +149,6 @@ fn delete(spec: &Path) -> anyhow::Result<()> {
Ok(false) => break,
Err(err) => {
debug!("is_active: {}", err);
- ()
}
}
debug!("{} is still running", spec.name);