File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 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"
2020lazy_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"
2426rustc_version = " 0.1.7"
2527
2628[lib ]
Original file line number Diff line number Diff line change 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;
37extern crate rustc_version;
48
59use std:: env;
610use std:: fs;
7- use rustc_serialize:: json;
811use std:: fs:: OpenOptions ;
912use std:: io:: { ErrorKind , Read } ;
1013use std:: path:: PathBuf ;
@@ -21,7 +24,7 @@ static UNIX_OCL_LIB_NAME: &'static str = "libafopencl";
2124static UNIX_UNI_LIB_NAME : & ' static str = "libaf" ;
2225
2326#[ allow( dead_code) ]
24- #[ derive( RustcDecodable ) ]
27+ #[ derive( Deserialize , Debug ) ]
2528struct 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
117120fn 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
You can’t perform that action at this time.
0 commit comments