@@ -22,10 +22,7 @@ print('''\
// Generated by make_idna_table.py
-use idna::Mapping::*;
-use idna::Range;
-
-pub static TABLE: &'static [Range] = &[
+static TABLE: &'static [Range] = &[
''')
txt = open("IdnaMappingTable.txt")
@@ -2,15 +2,17 @@
//!
//! https://url.spec.whatwg.org/#idna
-use idna_mapping::TABLE;
+use self::Mapping::*;
use punycode;
use std::ascii::AsciiExt;
use unicode_normalization::UnicodeNormalization;
use unicode_normalization::char::is_combining_mark;
use unicode_bidi::{BidiClass, bidi_class};
+include!("idna_mapping.rs");
+
#[derive(Debug)]
-pub enum Mapping {
+enum Mapping {
Valid,
Ignored,
Mapped(&'static str),
@@ -20,7 +22,7 @@ pub enum Mapping {
DisallowedStd3Mapped(&'static str),
}
-pub struct Range {
+struct Range {
pub from: char,
pub to: char,
pub mapping: Mapping,
@@ -8,10 +8,7 @@
Range { from: '\0', to: ',', mapping: DisallowedStd3Valid },
Range { from: '-', to: '.', mapping: Valid },
@@ -173,7 +173,6 @@ pub mod form_urlencoded;
pub mod punycode;
pub mod format;
pub mod idna;
-mod idna_mapping;
/// The parsed representation of an absolute URL.
#[derive(PartialEq, Eq, Clone, Debug, Hash, PartialOrd, Ord)]