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(), }) }