Skip to content

Commit 941dade

Browse files
committed
fixes set_port
1 parent 99a7488 commit 941dade

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

url/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ impl Url {
17701770
pub fn set_port(&mut self, mut port: Option<u16>) -> Result<(), ()> {
17711771
// has_host implies !cannot_be_a_base
17721772
if !self.has_host() || self.host() == Some(Host::Domain("")) || self.scheme() == "file" {
1773-
if port.is_some() {
1773+
if port.is_none() {
17741774
return Ok(());
17751775
}
17761776
return Err(());

0 commit comments

Comments
 (0)