Skip to content

Commit d3e2d4d

Browse files
authored
Merge pull request #130 from 9prady9/use_serde_for_serialization
Remove rustc_serialize in favor of Serde crate
2 parents abf8bf8 + d558748 commit d3e2d4d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ num = "0.1.32"
2020
lazy_static = "0.2.1"
2121

2222
[build-dependencies]
23-
rustc-serialize = "0.3.19"
23+
serde_json = "1.0.0"
24+
serde_derive = "1.0.1"
25+
serde = "1.0.1"
2426
rustc_version = "0.1.7"
2527

2628
[lib]

build.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
/* -- Lots of reuse from: https://github.com/alexcrichton/git2-rs/blob/master/libgit2-sys/build.rs */
2-
extern crate rustc_serialize;
2+
#[macro_use]
3+
extern crate serde_derive;
4+
5+
extern crate serde;
6+
extern crate serde_json;
37
extern crate rustc_version;
48

59
use std::env;
610
use std::fs;
7-
use rustc_serialize::json;
811
use std::fs::OpenOptions;
912
use std::io::{ErrorKind, Read};
1013
use std::path::PathBuf;
@@ -21,7 +24,7 @@ static UNIX_OCL_LIB_NAME: &'static str = "libafopencl";
2124
static UNIX_UNI_LIB_NAME: &'static str = "libaf";
2225

2326
#[allow(dead_code)]
24-
#[derive(RustcDecodable)]
27+
#[derive(Deserialize, Debug)]
2528
struct Config {
2629
// Use the existing lib if it exists
2730
use_lib: bool,
@@ -116,7 +119,7 @@ fn read_file(file_name: &std::path::PathBuf) -> String {
116119

117120
fn read_conf(conf_file: &std::path::PathBuf) -> Config {
118121
let raw_conf = read_file(conf_file);
119-
let decoded: Config = json::decode(&raw_conf).unwrap();
122+
let decoded: Config = serde_json::from_str(&raw_conf).unwrap();
120123
decoded
121124
}
122125

0 commit comments

Comments
 (0)