Skip to content

Commit d56ee65

Browse files
committed
mark domain_to_ascii and domain_to_unicode as deprecated (whatwg/url#63)
1 parent 4fbc5a6 commit d56ee65

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

url/src/quirks.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ pub fn internal_components(url: &Url) -> InternalComponents {
5757
}
5858
}
5959

60-
/// https://url.spec.whatwg.org/#dom-url-domaintoascii
60+
/// Converts a domain name to its ASCII (punycode) form.
61+
///
62+
/// This feature was never implemented by browsers, and
63+
/// [has been removed from the URL spec][0].
64+
///
65+
/// [0]: https://github.com/whatwg/url/issues/63
66+
#[deprecated]
6167
pub fn domain_to_ascii(domain: &str) -> String {
6268
match Host::parse(domain) {
6369
Ok(Host::Domain(domain)) => domain,
@@ -66,9 +72,15 @@ pub fn domain_to_ascii(domain: &str) -> String {
6672
}
6773

6874
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
69-
/// <https://url.spec.whatwg.org/#dom-url-domaintounicode>
75+
#[deprecated]
76+
/// Converts a domain name to its Unicode form.
77+
///
78+
/// This feature was never implemented by browsers, and
79+
/// [has been removed from the URL spec][0].
7080
///
7181
/// This feature is not available on `wasm32-unknown-unknown` targets.
82+
///
83+
/// [0]: https://github.com/whatwg/url/issues/63
7284
pub fn domain_to_unicode(domain: &str) -> String {
7385
match Host::parse(domain) {
7486
Ok(Host::Domain(ref domain)) => {

url/tests/unit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ fn test_set_href() {
771771
}
772772

773773
#[test]
774+
#[allow(deprecated)]
774775
fn test_domain_encoding_quirks() {
775776
use url::quirks::domain_to_ascii;
776777
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]

0 commit comments

Comments
 (0)