From aae91a9b53ea8e6d673a258e5fc9f871f40e08fd Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 1 Sep 2022 16:58:41 -0300 Subject: [PATCH] refactor(tauri-codegen): panic if local IP address cannot be resolved --- core/tauri-codegen/src/context.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/tauri-codegen/src/context.rs b/core/tauri-codegen/src/context.rs index 45b2e88c6..1ace8c10a 100644 --- a/core/tauri-codegen/src/context.rs +++ b/core/tauri-codegen/src/context.rs @@ -167,9 +167,8 @@ pub fn context_codegen(data: ContextData) -> Result false, }; if localhost { - if let Ok(ip) = local_ip_address::local_ip() { - url.set_host(Some(&ip.to_string())).unwrap(); - } + let ip = local_ip_address::local_ip().expect("failed to resolve local IP address"); + url.set_host(Some(&ip.to_string())).unwrap(); } } }