1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -96,7 +96,7 @@
use errors::{ErrorKind, ResultExt};
#[cfg(feature = "remote_list")]
use native_tls::TlsConnector;
-use idna::{domain_to_unicode, uts46};
+use idna::{domain_to_unicode, Config, Errors};
use url::Url;
/// The official URL of the list
@@ -675,11 +675,10 @@
}
fn to_ascii(domain: &str) -> Result<String> {
- let result = uts46::to_ascii(domain, uts46::Flags {
- use_std3_ascii_rules: false,
- transitional_processing: true,
- verify_dns_length: true,
- });
+ let result = idna::Config::default()
+ .transitional_processing(true)
+ .verify_dns_length(true)
+ .to_ascii(domain);
result.map_err(|error| ErrorKind::Uts46(error).into())
}
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -34,7 +34,7 @@
display("invalid domain: '{}'", t)
}
- Uts46(t: ::idna::uts46::Errors) {
+ Uts46(t: ::idna::Errors) {
description("UTS #46 processing failed")
display("UTS #46 processing error: '{:?}'", t)
}
|