Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on third-party matches crate #755

Merged
merged 3 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions data-url/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand Down
3 changes: 0 additions & 3 deletions data-url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
//! assert!(fragment.is_none());
//! ```

#[macro_use]
extern crate matches;

macro_rules! require {
($condition: expr) => {
if !$condition {
Expand Down
1 change: 0 additions & 1 deletion form_urlencoded/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ rust-version = "1.45"
test = false

[dependencies]
matches = "0.1"
percent-encoding = { version = "2.1.0", path = "../percent_encoding" }
3 changes: 0 additions & 3 deletions form_urlencoded/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion idna/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ serde_json = "1.0"
[dependencies]
unicode-bidi = "0.3"
unicode-normalization = "0.1.17"
matches = "0.1"

[[bench]]
name = "all"
Expand Down
3 changes: 2 additions & 1 deletion idna/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion url/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}

Expand Down
34 changes: 19 additions & 15 deletions url/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down