Skip to content

Commit 62cc614

Browse files
committed
Have an explicit impl Default for Config in idna
1 parent 5aeaf89 commit 62cc614

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

idna/src/uts46.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,30 @@ fn processing(domain: &str, config: Config, errors: &mut Vec<Error>) -> String {
371371
validated
372372
}
373373

374-
#[derive(Clone, Copy, Default)]
374+
#[derive(Clone, Copy)]
375375
pub struct Config {
376376
use_std3_ascii_rules: bool,
377377
transitional_processing: bool,
378378
verify_dns_length: bool,
379379
check_hyphens: bool,
380380
}
381381

382+
/// The defaults are that of https://url.spec.whatwg.org/#idna
383+
impl Default for Config {
384+
fn default() -> Self {
385+
Config {
386+
use_std3_ascii_rules: false,
387+
transitional_processing: false,
388+
check_hyphens: false,
389+
// check_bidi: true,
390+
// check_joiners: true,
391+
392+
// Only use for to_ascii, not to_unicode
393+
verify_dns_length: false,
394+
}
395+
}
396+
}
397+
382398
impl Config {
383399
#[inline]
384400
pub fn use_std3_ascii_rules(mut self, value: bool) -> Self {

0 commit comments

Comments
 (0)