Skip to content

Commit 70b08b2

Browse files
authored
Merge pull request #2053 from Kobzol/fix-stable-benchmarks
Fix stable benchmarks
2 parents c20bd09 + 94e49fc commit 70b08b2

File tree

4 files changed

+126
-27
lines changed

4 files changed

+126
-27
lines changed

collector/compile-benchmarks/html5ever/Cargo.lock

Lines changed: 89 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/compile-benchmarks/html5ever/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name = "html5ever"
44
version = "0.5.4"
5-
authors = [ "The html5ever Project Developers" ]
5+
authors = ["The html5ever Project Developers"]
66
license = "MIT / Apache-2.0"
77
repository = "https://github.com/servo/html5ever"
88
description = "High-performance browser-grade HTML5 parser"
@@ -35,7 +35,8 @@ rustc-test = "0.1.3"
3535

3636
[build-dependencies]
3737
phf_codegen = "0.7.3"
38-
rustc-serialize = "0.3.15"
38+
serde_json = "1"
39+
serde = { version = "1", features = ["derive"] }
3940
html5ever_macros = { version = "0.2.6", path = "macros", optional = true }
4041

4142
[profile.dev]

collector/compile-benchmarks/html5ever/build.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
#![feature(rustc_encodable_decodable)]
11-
1210
extern crate phf_codegen;
13-
extern crate rustc_serialize;
1411

15-
use rustc_serialize::json::{Json, Decoder};
16-
use rustc_serialize::Decodable;
1712
use std::collections::HashMap;
1813
use std::env;
1914
use std::fs::File;
@@ -99,14 +94,13 @@ fn check_hash(from: &Path, to: &Path) -> Result<(), String> {
9994

10095
fn named_entities_to_phf(from: &Path, to: &Path) {
10196
// A struct matching the entries in entities.json.
102-
#[derive(RustcDecodable)]
97+
#[derive(serde::Deserialize)]
10398
struct CharRef {
10499
codepoints: Vec<u32>,
105100
//characters: String, // Present in the file but we don't need it
106101
}
107102

108-
let json = Json::from_reader(&mut File::open(from).unwrap()).unwrap();
109-
let entities: HashMap<String, CharRef> = Decodable::decode(&mut Decoder::new(json)).unwrap();
103+
let entities: HashMap<String, CharRef> = serde_json::from_reader(&mut File::open(from).unwrap()).unwrap();
110104
let mut entities: HashMap<&str, (u32, u32)> = entities.iter().map(|(name, char_ref)| {
111105
assert!(name.starts_with("&"));
112106
assert!(char_ref.codepoints.len() <= 2);
@@ -115,7 +109,7 @@ fn named_entities_to_phf(from: &Path, to: &Path) {
115109

116110
// Add every missing prefix of those keys, mapping to NULL characters.
117111
for key in entities.keys().cloned().collect::<Vec<_>>() {
118-
for n in 1 .. key.len() {
112+
for n in 1..key.len() {
119113
entities.entry(&key[..n]).or_insert((0, 0));
120114
}
121115
}

collector/compile-benchmarks/piston-image/Cargo.lock

Lines changed: 31 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)