Skip to content

Commit 21aed6e

Browse files
authored
Merge pull request #665 from Johann150/master
small documentation inaccuracy
2 parents 8bede54 + f62b0d9 commit 21aed6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

url/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,8 @@ impl Url {
803803

804804
/// Return the string representation of the host (domain or IP address) for this URL, if any.
805805
///
806-
/// Non-ASCII domains are punycode-encoded per IDNA.
806+
/// Non-ASCII domains are punycode-encoded per IDNA if this is the host
807+
/// of a special URL, or percent encoded for non-special URLs.
807808
/// IPv6 addresses are given between `[` and `]` brackets.
808809
///
809810
/// Cannot-be-a-base URLs (typical of `data:` and `mailto:`) and some `file:` URLs
@@ -842,7 +843,8 @@ impl Url {
842843
}
843844

844845
/// Return the parsed representation of the host for this URL.
845-
/// Non-ASCII domain labels are punycode-encoded per IDNA.
846+
/// Non-ASCII domain labels are punycode-encoded per IDNA if this is the host
847+
/// of a special URL, or percent encoded for non-special URLs.
846848
///
847849
/// Cannot-be-a-base URLs (typical of `data:` and `mailto:`) and some `file:` URLs
848850
/// don’t have a host.
@@ -881,6 +883,8 @@ impl Url {
881883
}
882884

883885
/// If this URL has a host and it is a domain name (not an IP address), return it.
886+
/// Non-ASCII domains are punycode-encoded per IDNA if this is the host
887+
/// of a special URL, or percent encoded for non-special URLs.
884888
///
885889
/// # Examples
886890
///

0 commit comments

Comments
 (0)