From 38fe58ea9b1fea2480eca82d4d9fb55a4f194397 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 3 Sep 2023 15:58:06 +0100 Subject: [PATCH] Improve soundness --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d4af63e..8c5986b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,14 +27,14 @@ impl DokkuApp { return None; } - let current_vhosts = read_to_string(&vhost_path).await.unwrap(); + let current_vhosts = read_to_string(&vhost_path).await.ok()?; if current_vhosts.is_empty() { return None; } Some(DokkuApp { - name: String::from(path.file_name().unwrap().to_str().unwrap()), + name: String::from(path.file_name()?.to_str()?), hosts: current_vhosts.lines().map(String::from).collect(), }) }