Skip to content

Commit

Permalink
fixes set_port
Browse files Browse the repository at this point in the history
  • Loading branch information
chanced committed Aug 4, 2023
1 parent 99a7488 commit 941dade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ impl Url {
pub fn set_port(&mut self, mut port: Option<u16>) -> 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(());
Expand Down

0 comments on commit 941dade

Please sign in to comment.