From cacf8ddf2da9c80574647aeb0d61dd15f9f8c5d5 Mon Sep 17 00:00:00 2001 From: Quentin Date: Tue, 10 Nov 2020 15:52:20 +0100 Subject: [PATCH] Panic when it is a logical error --- src/web/web_server.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/web/web_server.rs b/src/web/web_server.rs index e4d15872..73aa6648 100644 --- a/src/web/web_server.rs +++ b/src/web/web_server.rs @@ -77,10 +77,7 @@ fn authority_to_host(authority: &str) -> Result<&str, Error> { let split = match first_char { '[' => { let mut iter = iter.skip_while(|(_, c)| c != &']'); - iter.next().ok_or(Error::BadRequest(format!( - "Authority {} has an illegal format", - authority - )))?; + iter.next().expect("Authority parsing logic error"); iter.next() } _ => iter.skip_while(|(_, c)| c != &':').next(),