|
@@ -371,7 +371,7 @@ fn processing(domain: &str, config: Config, errors: &mut Vec<Error>) -> String {
|
|
|
validated
|
|
validated
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#[derive(Clone, Copy, Default)]
|
|
|
|
|
|
|
+#[derive(Clone, Copy)]
|
|
|
pub struct Config {
|
|
pub struct Config {
|
|
|
use_std3_ascii_rules: bool,
|
|
use_std3_ascii_rules: bool,
|
|
|
transitional_processing: bool,
|
|
transitional_processing: bool,
|
|
@@ -379,6 +379,22 @@ pub struct Config {
|
|
|
check_hyphens: bool,
|
|
check_hyphens: bool,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/// The defaults are that of https://url.spec.whatwg.org/#idna
|
|
|
|
|
+impl Default for Config {
|
|
|
|
|
+ fn default() -> Self {
|
|
|
|
|
+ Config {
|
|
|
|
|
+ use_std3_ascii_rules: false,
|
|
|
|
|
+ transitional_processing: false,
|
|
|
|
|
+ check_hyphens: false,
|
|
|
|
|
+ // check_bidi: true,
|
|
|
|
|
+ // check_joiners: true,
|
|
|
|
|
+
|
|
|
|
|
+ // Only use for to_ascii, not to_unicode
|
|
|
|
|
+ verify_dns_length: false,
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
impl Config {
|
|
impl Config {
|
|
|
#[inline]
|
|
#[inline]
|
|
|
pub fn use_std3_ascii_rules(mut self, value: bool) -> Self {
|
|
pub fn use_std3_ascii_rules(mut self, value: bool) -> Self {
|