From 43ad94f08db2aa676c0f2afd45a24b88e8b3810e Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Tue, 3 Jan 2023 09:25:10 +0000 Subject: [PATCH] refactor: [#142] replace unwrap with expect --- src/setup.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/setup.rs b/src/setup.rs index 84a1d1c3c..daee7eea8 100644 --- a/src/setup.rs +++ b/src/setup.rs @@ -60,7 +60,9 @@ pub async fn setup(config: &Configuration, tracker: Arc) -> Ve if config.http_api.enabled { // Temporarily running the new API in the 1313 port let bind_address = config.http_api.bind_address.clone(); - let mut bind_socket: SocketAddr = bind_address.parse().unwrap(); + let mut bind_socket: SocketAddr = bind_address + .parse() + .expect("bind address should be a valid socket address, for example 127.0.0.1:8080"); bind_socket.set_port(1313); let mut http_apis_config = config.http_api.clone();