Skip to content

Commit

Permalink
Auto merge of #519 - servo:percent-encoding-consts, r=nox
Browse files Browse the repository at this point in the history
percent-encoding: make sets be values of one type, instead of types that implement a trait

Fix #388

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/519)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jul 17, 2019
2 parents e121d8d + a1fe49e commit 4e38c16
Show file tree
Hide file tree
Showing 11 changed files with 278 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,7 @@ script: cargo test --all-features --all

jobs:
include:
- rust: 1.30.0
- rust: 1.33.0
- rust: stable
- rust: beta
- rust: nightly
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -39,7 +39,7 @@ bencher = "0.1"
[dependencies]
idna = { version = "0.2.0", path = "./idna" }
matches = "0.1"
percent-encoding = { version = "1.0.0", path = "./percent_encoding" }
percent-encoding = { version = "2.0.0", path = "./percent_encoding" }
serde = {version = "1.0", optional = true}

[[bench]]
Expand Down
6 changes: 3 additions & 3 deletions data-url/src/lib.rs
Expand Up @@ -103,7 +103,7 @@ impl<'a> FragmentIdentifier<'a> {
match byte {
// Ignore ASCII tabs or newlines like the URL parser would
b'\t' | b'\n' | b'\r' => continue,
// Fragment encode set
// https://url.spec.whatwg.org/#fragment-percent-encode-set
b'\0'...b' ' | b'"' | b'<' | b'>' | b'`' | b'\x7F'...b'\xFF' => {
percent_encode(byte, &mut string)
}
Expand Down Expand Up @@ -182,10 +182,10 @@ fn parse_header(from_colon_to_comma: &str) -> (mime::Mime, bool) {
// Ignore ASCII tabs or newlines like the URL parser would
b'\t' | b'\n' | b'\r' => continue,

// C0 encode set
// https://url.spec.whatwg.org/#c0-control-percent-encode-set
b'\0'...b'\x1F' | b'\x7F'...b'\xFF' => percent_encode(byte, &mut string),

// Bytes other than the C0 encode set that are percent-encoded
// Bytes other than the C0 percent-encode set that are percent-encoded
// by the URL parser in the query state.
// '#' is also in that list but cannot occur here
// since it indicates the start of the URL’s fragment.
Expand Down
3 changes: 1 addition & 2 deletions percent_encoding/Cargo.toml
@@ -1,12 +1,11 @@
[package]
name = "percent-encoding"
version = "1.0.2"
version = "2.0.0"
authors = ["The rust-url developers"]
description = "Percent encoding and decoding"
repository = "https://github.com/servo/rust-url/"
license = "MIT/Apache-2.0"

[lib]
doctest = false
test = false
path = "lib.rs"

0 comments on commit 4e38c16

Please sign in to comment.