Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Oct 14, 2023
1 parent 28ab2b1 commit 36f92e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions srt-protocol/src/options/srt_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ impl SrtVersion {

impl PartialOrd for SrtVersion {
fn partial_cmp(&self, other: &SrtVersion) -> Option<Ordering> {
Some(match self.major.cmp(&other.major) {
Ordering::Equal => match self.minor.cmp(&other.minor) {
Ordering::Equal => self.patch.cmp(&other.patch),
o => o,
},
o => o,
})
Some(self.cmp(other))
}
}

impl Ord for SrtVersion {
fn cmp(&self, other: &SrtVersion) -> Ordering {
self.partial_cmp(other).unwrap() // this cannot fail
match self.major.cmp(&other.major) {
Ordering::Equal => match self.minor.cmp(&other.minor) {
Ordering::Equal => self.patch.cmp(&other.patch),
o => o,
},
o => o,
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion srt-transmit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn local_port_addr(url: &Url, kind: &str) -> Result<(u16, Option<SocketAddr>), E
Ok(match url.host() {
// no host means bind to the port specified
None => (port, None),
Some(Host::Domain(d)) if d == "0.0.0.0" => (port, None),
Some(Host::Domain("0.0.0.0")) => (port, None),

// if host is specified, bind to 0
Some(Host::Domain(d)) => (
Expand Down

0 comments on commit 36f92e6

Please sign in to comment.