summaryrefslogtreecommitdiffstats
path: root/vendor/idna
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/idna')
-rw-r--r--vendor/idna/.cargo-checksum.json2
-rw-r--r--vendor/idna/Cargo.toml19
-rw-r--r--vendor/idna/src/lib.rs12
-rw-r--r--vendor/idna/src/punycode.rs7
-rw-r--r--vendor/idna/src/uts46.rs19
-rw-r--r--vendor/idna/tests/punycode.rs2
6 files changed, 45 insertions, 16 deletions
diff --git a/vendor/idna/.cargo-checksum.json b/vendor/idna/.cargo-checksum.json
index edf5c94ba..ccbcd7a9f 100644
--- a/vendor/idna/.cargo-checksum.json
+++ b/vendor/idna/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"e8c4cbd1a352ce9085b80ac9fcaa8468a2da84b615adf01e719a3020a0279e4c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"76e972ac0f4ddb116e86e10100132a783931a596e7b9872eaa31be15cd4d751d","benches/all.rs":"e734b9c9092ed66986725f86cfe90f3756cfddb058af308b796ba494f9beefc2","src/IdnaMappingTable.txt":"87d6553a4b86bc49dcade38bf26b745cd81800eb8af295dc3fb99b4729eaea38","src/lib.rs":"498f127759fa79bda0d264f373ab7230cc2c73ef3a7b532d619c2a513abb53ff","src/make_uts46_mapping_table.py":"917055fa841f813de2bcf79cc79b595da3d5551559ee768db8660ab77cb26c34","src/punycode.rs":"07edf5293bc384a164eebb01bc18fe3d4b2d009b4565a36b74a3030978ea6e04","src/uts46.rs":"1a5604c32cf57b50e846b58aaaba94e685ff10975e9d6d82ae953f8cefe9c028","src/uts46_mapping_table.rs":"942fff78147c61da942f5f3a7ff4e90f9d7a00a29285733ac3fc3357eb2ed06f","tests/IdnaTestV2.txt":"c6f3778b0545fd150c8063286c7f5adc901e16557eddccc3751213646d07593d","tests/punycode.rs":"7eb6215fa4c84e6710682d48dffe19e490aea223b554b97c180a7d504b9e492a","tests/punycode_tests.json":"3d4ac0cf25984c37b9ce197f5df680a0136f728fb8ec82bc76624e42139eb3a8","tests/tests.rs":"d205a2bfb29dfee73e014faebd3207a55ef0d40121e6dbd52f5d611b37ac111e","tests/unit.rs":"be025a7d9bab3bd1ce134c87f9d848269e157b31ca5ba0ea03426c1ac736b69e","tests/uts46.rs":"06c97bf7dc20f5372b542fa46922d6dd63fe15e0aa34d799d08df9e3a241aa21"},"package":"e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"} \ No newline at end of file
+{"files":{"Cargo.toml":"32d6c206ec373e92afd20d07a6337c45e069b00e4a80344c82f010e72eb22605","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"76e972ac0f4ddb116e86e10100132a783931a596e7b9872eaa31be15cd4d751d","benches/all.rs":"e734b9c9092ed66986725f86cfe90f3756cfddb058af308b796ba494f9beefc2","src/IdnaMappingTable.txt":"87d6553a4b86bc49dcade38bf26b745cd81800eb8af295dc3fb99b4729eaea38","src/lib.rs":"e7fd80070a7e52dfd1e9fe785bf092eddc9fb421fd0f9a1ba1c2189b8d40d3ed","src/make_uts46_mapping_table.py":"917055fa841f813de2bcf79cc79b595da3d5551559ee768db8660ab77cb26c34","src/punycode.rs":"0e4a879cffee5af747ab3042928b4ff682b1c4881b40f9f241511668109ae124","src/uts46.rs":"f2dc62e5d7472eba2676e073bf5c0a4c635da5487740d8dc4310f61831859702","src/uts46_mapping_table.rs":"942fff78147c61da942f5f3a7ff4e90f9d7a00a29285733ac3fc3357eb2ed06f","tests/IdnaTestV2.txt":"c6f3778b0545fd150c8063286c7f5adc901e16557eddccc3751213646d07593d","tests/punycode.rs":"cd55e1ba1150a3a2a05aec6617affd1fed38c53cb344024a6556918a02ced78d","tests/punycode_tests.json":"3d4ac0cf25984c37b9ce197f5df680a0136f728fb8ec82bc76624e42139eb3a8","tests/tests.rs":"d205a2bfb29dfee73e014faebd3207a55ef0d40121e6dbd52f5d611b37ac111e","tests/unit.rs":"be025a7d9bab3bd1ce134c87f9d848269e157b31ca5ba0ea03426c1ac736b69e","tests/uts46.rs":"06c97bf7dc20f5372b542fa46922d6dd63fe15e0aa34d799d08df9e3a241aa21"},"package":"7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"} \ No newline at end of file
diff --git a/vendor/idna/Cargo.toml b/vendor/idna/Cargo.toml
index fa2ed42bc..373951542 100644
--- a/vendor/idna/Cargo.toml
+++ b/vendor/idna/Cargo.toml
@@ -13,10 +13,11 @@
edition = "2018"
rust-version = "1.51"
name = "idna"
-version = "0.3.0"
+version = "0.4.0"
authors = ["The rust-url developers"]
autotests = false
description = "IDNA (Internationalizing Domain Names in Applications) and Punycode."
+categories = ["no_std"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/rust-url/"
@@ -35,10 +36,13 @@ name = "all"
harness = false
[dependencies.unicode-bidi]
-version = "0.3"
+version = "0.3.10"
+features = ["hardcoded-data"]
+default-features = false
[dependencies.unicode-normalization]
-version = "0.1.17"
+version = "0.1.22"
+default-features = false
[dev-dependencies.assert_matches]
version = "1.3"
@@ -51,3 +55,12 @@ version = "1.0"
[dev-dependencies.tester]
version = "0.9"
+
+[features]
+alloc = []
+default = ["std"]
+std = [
+ "alloc",
+ "unicode-bidi/std",
+ "unicode-normalization/std",
+]
diff --git a/vendor/idna/src/lib.rs b/vendor/idna/src/lib.rs
index 37d638741..92914f9ba 100644
--- a/vendor/idna/src/lib.rs
+++ b/vendor/idna/src/lib.rs
@@ -31,11 +31,23 @@
//! > This document specifies a mechanism
//! > that minimizes the impact of this transition for client software,
//! > allowing client software to access domains that are valid under either system.
+#![no_std]
+
+// For forwards compatibility
+#[cfg(feature = "std")]
+extern crate std;
+
+extern crate alloc;
+
+#[cfg(not(feature = "alloc"))]
+compile_error!("the `alloc` feature must be enabled");
#[cfg(test)]
#[macro_use]
extern crate assert_matches;
+use alloc::string::String;
+
pub mod punycode;
mod uts46;
diff --git a/vendor/idna/src/punycode.rs b/vendor/idna/src/punycode.rs
index 21955f359..faef379ca 100644
--- a/vendor/idna/src/punycode.rs
+++ b/vendor/idna/src/punycode.rs
@@ -13,8 +13,9 @@
//! `encode_str` and `decode_to_string` provide convenience wrappers
//! that convert from and to Rust’s UTF-8 based `str` and `String` types.
-use std::char;
-use std::u32;
+use alloc::{string::String, vec::Vec};
+use core::char;
+use core::u32;
// Bootstring parameters for Punycode
static BASE: u32 = 36;
@@ -168,7 +169,7 @@ impl Decoder {
}
pub(crate) struct Decode<'a> {
- base: std::str::Chars<'a>,
+ base: core::str::Chars<'a>,
pub(crate) insertions: &'a [(usize, char)],
inserted: usize,
position: usize,
diff --git a/vendor/idna/src/uts46.rs b/vendor/idna/src/uts46.rs
index ec2fd0b10..fb39c1512 100644
--- a/vendor/idna/src/uts46.rs
+++ b/vendor/idna/src/uts46.rs
@@ -11,7 +11,9 @@
use self::Mapping::*;
use crate::punycode;
-use std::{error::Error as StdError, fmt};
+
+use alloc::string::String;
+use core::fmt;
use unicode_bidi::{bidi_class, BidiClass};
use unicode_normalization::char::is_combining_mark;
use unicode_normalization::{is_nfc, UnicodeNormalization};
@@ -70,10 +72,10 @@ fn find_char(codepoint: char) -> &'static Mapping {
}
struct Mapper<'a> {
- chars: std::str::Chars<'a>,
+ chars: core::str::Chars<'a>,
config: Config,
errors: &'a mut Errors,
- slice: Option<std::str::Chars<'static>>,
+ slice: Option<core::str::Chars<'static>>,
}
impl<'a> Iterator for Mapper<'a> {
@@ -274,7 +276,7 @@ fn passes_bidi(label: &str, is_bidi_domain: bool) -> bool {
/// http://www.unicode.org/reports/tr46/#Validity_Criteria
fn check_validity(label: &str, config: Config, errors: &mut Errors) {
let first_char = label.chars().next();
- if first_char == None {
+ if first_char.is_none() {
// Empty string, pass
return;
}
@@ -475,7 +477,7 @@ impl Idna {
/// http://www.unicode.org/reports/tr46/#ToASCII
#[allow(clippy::wrong_self_convention)]
- pub fn to_ascii<'a>(&'a mut self, domain: &str, out: &mut String) -> Result<(), Errors> {
+ pub fn to_ascii(&mut self, domain: &str, out: &mut String) -> Result<(), Errors> {
let mut errors = self.to_ascii_inner(domain, out);
if self.config.verify_dns_length {
@@ -497,7 +499,7 @@ impl Idna {
/// http://www.unicode.org/reports/tr46/#ToUnicode
#[allow(clippy::wrong_self_convention)]
- pub fn to_unicode<'a>(&'a mut self, domain: &str, out: &mut String) -> Result<(), Errors> {
+ pub fn to_unicode(&mut self, domain: &str, out: &mut String) -> Result<(), Errors> {
if is_simple(domain) {
out.push_str(domain);
return Errors::default().into();
@@ -685,7 +687,7 @@ impl fmt::Debug for Errors {
if !empty {
f.write_str(", ")?;
}
- f.write_str(*name)?;
+ f.write_str(name)?;
empty = false;
}
}
@@ -708,7 +710,8 @@ impl From<Errors> for Result<(), Errors> {
}
}
-impl StdError for Errors {}
+#[cfg(feature = "std")]
+impl std::error::Error for Errors {}
impl fmt::Display for Errors {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
diff --git a/vendor/idna/tests/punycode.rs b/vendor/idna/tests/punycode.rs
index 1a51cbc92..95674137a 100644
--- a/vendor/idna/tests/punycode.rs
+++ b/vendor/idna/tests/punycode.rs
@@ -41,7 +41,7 @@ fn one_test(decoded: &str, encoded: &str) {
fn get_string<'a>(map: &'a Map<String, Value>, key: &str) -> &'a str {
match map.get(&key.to_string()) {
- Some(&Value::String(ref s)) => s,
+ Some(Value::String(s)) => s,
None => "",
_ => panic!(),
}