Skip to content

Commit

Permalink
PR fix: fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ivila committed Nov 20, 2024
1 parent 51dfc25 commit 5a9f01e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct HttpUrl {

impl HttpUrl {
pub fn port(&self) -> u16 {
// this should always go to the happy path as we only have scheme of http and https
// this will never fail because we verified the scheme is HTTP or HTTPS which should always have a port
self.url.port_or_known_default().unwrap()
}
pub fn scheme(&self) -> Scheme {
Expand Down Expand Up @@ -78,7 +78,7 @@ impl TryFrom<Url> for HttpUrl {
if scheme != Scheme::Http && scheme != Scheme::Https {
return Err(error_unsupported_url_scheme(url.scheme()));
};
// host must exist in http and https, and url crate ensure about it, see test check_url_must_have_host
// HTTP and HTTPS URLs must always have a host, see the check_url_must_have_host test
let host = url.host_str().unwrap();
Ok(Self {
scheme,
Expand Down

0 comments on commit 5a9f01e

Please sign in to comment.