From 941dade47a3036c251b37bdaaa4af29086ec4124 Mon Sep 17 00:00:00 2001 From: Chance Date: Fri, 4 Aug 2023 11:24:11 -0400 Subject: [PATCH] fixes set_port --- url/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url/src/lib.rs b/url/src/lib.rs index 9b20df417..3d6326c7d 100644 --- a/url/src/lib.rs +++ b/url/src/lib.rs @@ -1770,7 +1770,7 @@ impl Url { pub fn set_port(&mut self, mut port: Option) -> Result<(), ()> { // has_host implies !cannot_be_a_base if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" { - if port.is_some() { + if port.is_none() { return Ok(()); } return Err(());