Skip to content

Commit 48fcbe1

Browse files
authored
Merge pull request #755 from notriddle/notriddle/matches
Remove dependency on third-party matches crate
2 parents 8e3e91d + fd62d12 commit 48fcbe1

File tree

9 files changed

+21
-30
lines changed

9 files changed

+21
-30
lines changed

data-url/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ edition = "2018"
99
autotests = false
1010
rust-version = "1.45"
1111

12-
[dependencies]
13-
matches = "0.1"
14-
1512
[dev-dependencies]
1613
tester = "0.9"
1714
serde = {version = "1.0", features = ["derive"]}

data-url/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
//! assert!(fragment.is_none());
1616
//! ```
1717
18-
#[macro_use]
19-
extern crate matches;
20-
2118
macro_rules! require {
2219
($condition: expr) => {
2320
if !$condition {

form_urlencoded/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ rust-version = "1.45"
1212
test = false
1313

1414
[dependencies]
15-
matches = "0.1"
1615
percent-encoding = { version = "2.1.0", path = "../percent_encoding" }

form_urlencoded/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
//! Converts between a string (such as an URL’s query string)
1414
//! and a sequence of (name, value) pairs.
1515
16-
#[macro_use]
17-
extern crate matches;
18-
1916
use percent_encoding::{percent_decode, percent_encode_byte};
2017
use std::borrow::{Borrow, Cow};
2118
use std::str;

idna/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ serde_json = "1.0"
2828
[dependencies]
2929
unicode-bidi = "0.3"
3030
unicode-normalization = "0.1.17"
31-
matches = "0.1"
3231

3332
[[bench]]
3433
name = "all"

idna/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@
3232
//! > that minimizes the impact of this transition for client software,
3333
//! > allowing client software to access domains that are valid under either system.
3434
35+
#[cfg(test)]
3536
#[macro_use]
36-
extern crate matches;
37+
extern crate assert_matches;
3738

3839
pub mod punycode;
3940
mod uts46;

url/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ bencher = "0.1"
2727
[dependencies]
2828
form_urlencoded = { version = "1.0.0", path = "../form_urlencoded" }
2929
idna = { version = "0.2.0", path = "../idna", optional = true }
30-
matches = "0.1"
3130
percent-encoding = { version = "2.1.0", path = "../percent_encoding" }
3231
serde = {version = "1.0", optional = true, features = ["derive"]}
3332

url/src/host.rs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,25 @@ impl Host<String> {
9090
}
9191

9292
let is_invalid_domain_char = |c| {
93-
matches!(c, |'\0'..='\u{001F}'| ' '
94-
| '#'
95-
| '%'
96-
| '/'
97-
| ':'
98-
| '<'
99-
| '>'
100-
| '?'
101-
| '@'
102-
| '['
103-
| '\\'
104-
| ']'
105-
| '^'
106-
| '\u{007F}'
107-
| '|')
93+
matches!(
94+
c,
95+
'\0'..='\u{001F}'
96+
| ' '
97+
| '#'
98+
| '%'
99+
| '/'
100+
| ':'
101+
| '<'
102+
| '>'
103+
| '?'
104+
| '@'
105+
| '['
106+
| '\\'
107+
| ']'
108+
| '^'
109+
| '\u{007F}'
110+
| '|'
111+
)
108112
};
109113

110114
if domain.find(is_invalid_domain_char).is_some() {

url/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ url = { version = "2", default-features = false }
132132

133133
#![doc(html_root_url = "https://docs.rs/url/2.2.2")]
134134

135-
#[macro_use]
136-
extern crate matches;
137135
pub use form_urlencoded;
138136

139137
#[cfg(feature = "serde")]

0 commit comments

Comments
 (0)