Parcourir la source

Merge pull request #755 from notriddle/notriddle/matches

Remove dependency on third-party matches crate
Valentin Gosu il y a 4 ans
Parent
commit
48fcbe1c54

+ 0 - 3
data-url/Cargo.toml

@@ -9,9 +9,6 @@ edition = "2018"
 autotests = false
 rust-version = "1.45"
 
-[dependencies]
-matches = "0.1"
-
 [dev-dependencies]
 tester = "0.9"
 serde = {version = "1.0", features = ["derive"]}

+ 0 - 3
data-url/src/lib.rs

@@ -15,9 +15,6 @@
 //! assert!(fragment.is_none());
 //! ```
 
-#[macro_use]
-extern crate matches;
-
 macro_rules! require {
     ($condition: expr) => {
         if !$condition {

+ 0 - 1
form_urlencoded/Cargo.toml

@@ -12,5 +12,4 @@ rust-version = "1.45"
 test = false
 
 [dependencies]
-matches = "0.1"
 percent-encoding = { version = "2.1.0", path = "../percent_encoding" }

+ 0 - 3
form_urlencoded/src/lib.rs

@@ -13,9 +13,6 @@
 //! Converts between a string (such as an URL’s query string)
 //! and a sequence of (name, value) pairs.
 
-#[macro_use]
-extern crate matches;
-
 use percent_encoding::{percent_decode, percent_encode_byte};
 use std::borrow::{Borrow, Cow};
 use std::str;

+ 0 - 1
idna/Cargo.toml

@@ -28,7 +28,6 @@ serde_json = "1.0"
 [dependencies]
 unicode-bidi = "0.3"
 unicode-normalization = "0.1.17"
-matches = "0.1"
 
 [[bench]]
 name = "all"

+ 2 - 1
idna/src/lib.rs

@@ -32,8 +32,9 @@
 //! > that minimizes the impact of this transition for client software,
 //! > allowing client software to access domains that are valid under either system.
 
+#[cfg(test)]
 #[macro_use]
-extern crate matches;
+extern crate assert_matches;
 
 pub mod punycode;
 mod uts46;

+ 0 - 1
url/Cargo.toml

@@ -27,7 +27,6 @@ bencher = "0.1"
 [dependencies]
 form_urlencoded = { version = "1.0.0", path = "../form_urlencoded" }
 idna = { version = "0.2.0", path = "../idna", optional = true }
-matches = "0.1"
 percent-encoding = { version = "2.1.0", path = "../percent_encoding" }
 serde = {version = "1.0", optional = true, features = ["derive"]}
 

+ 19 - 15
url/src/host.rs

@@ -90,21 +90,25 @@ impl Host<String> {
         }
 
         let is_invalid_domain_char = |c| {
-            matches!(c, |'\0'..='\u{001F}'| ' '
-                | '#'
-                | '%'
-                | '/'
-                | ':'
-                | '<'
-                | '>'
-                | '?'
-                | '@'
-                | '['
-                | '\\'
-                | ']'
-                | '^'
-                | '\u{007F}'
-                | '|')
+            matches!(
+                c,
+                '\0'..='\u{001F}'
+                    | ' '
+                    | '#'
+                    | '%'
+                    | '/'
+                    | ':'
+                    | '<'
+                    | '>'
+                    | '?'
+                    | '@'
+                    | '['
+                    | '\\'
+                    | ']'
+                    | '^'
+                    | '\u{007F}'
+                    | '|'
+            )
         };
 
         if domain.find(is_invalid_domain_char).is_some() {

+ 0 - 2
url/src/lib.rs

@@ -132,8 +132,6 @@ url = { version = "2", default-features = false }
 
 #![doc(html_root_url = "https://docs.rs/url/2.2.2")]
 
-#[macro_use]
-extern crate matches;
 pub use form_urlencoded;
 
 #[cfg(feature = "serde")]