Преглед изворни кода

Make the uts46 module private

Simon Sapin пре 7 година
родитељ
комит
5aeaf89afe
3 измењених фајлова са 6 додато и 4 уклоњено
  1. 3 1
      idna/src/lib.rs
  2. 1 1
      idna/src/uts46.rs
  3. 2 2
      src/parser.rs

+ 3 - 1
idna/src/lib.rs

@@ -38,7 +38,9 @@ extern crate unicode_bidi;
 extern crate unicode_normalization;
 
 pub mod punycode;
-pub mod uts46;
+mod uts46;
+
+pub use uts46::{Config, Errors};
 
 /// The [domain to ASCII](https://url.spec.whatwg.org/#concept-domain-to-ascii) algorithm.
 ///

+ 1 - 1
idna/src/uts46.rs

@@ -18,7 +18,7 @@ use unicode_normalization::UnicodeNormalization;
 
 include!("uts46_mapping_table.rs");
 
-pub static PUNYCODE_PREFIX: &'static str = "xn--";
+const PUNYCODE_PREFIX: &'static str = "xn--";
 
 #[derive(Debug)]
 struct StringTableSlice {

+ 2 - 2
src/parser.rs

@@ -67,8 +67,8 @@ impl fmt::Display for ParseError {
     }
 }
 
-impl From<::idna::uts46::Errors> for ParseError {
-    fn from(_: ::idna::uts46::Errors) -> ParseError {
+impl From<::idna::Errors> for ParseError {
+    fn from(_: ::idna::Errors) -> ParseError {
         ParseError::IdnaError
     }
 }