File tree 2 files changed +10
-5
lines changed 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ num = "0.1.32"
20
20
lazy_static = " 0.2.1"
21
21
22
22
[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"
24
26
rustc_version = " 0.1.7"
25
27
26
28
[lib ]
Original file line number Diff line number Diff line change 1
1
/* -- 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;
3
7
extern crate rustc_version;
4
8
5
9
use std:: env;
6
10
use std:: fs;
7
- use rustc_serialize:: json;
8
11
use std:: fs:: OpenOptions ;
9
12
use std:: io:: { ErrorKind , Read } ;
10
13
use std:: path:: PathBuf ;
@@ -21,7 +24,7 @@ static UNIX_OCL_LIB_NAME: &'static str = "libafopencl";
21
24
static UNIX_UNI_LIB_NAME : & ' static str = "libaf" ;
22
25
23
26
#[ allow( dead_code) ]
24
- #[ derive( RustcDecodable ) ]
27
+ #[ derive( Deserialize , Debug ) ]
25
28
struct Config {
26
29
// Use the existing lib if it exists
27
30
use_lib : bool ,
@@ -116,7 +119,7 @@ fn read_file(file_name: &std::path::PathBuf) -> String {
116
119
117
120
fn read_conf ( conf_file : & std:: path:: PathBuf ) -> Config {
118
121
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 ( ) ;
120
123
decoded
121
124
}
122
125
You can’t perform that action at this time.
0 commit comments