diff --git a/Cargo.lock b/Cargo.lock index 4ed812bbfd..073ea6c1b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -232,10 +232,10 @@ version = "0.4.0" dependencies = [ "curl 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "env_proxy 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -261,7 +261,7 @@ dependencies = [ [[package]] name = "error-chain" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -420,12 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -654,7 +649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.17 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -699,6 +694,11 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "quote" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rand" version = "0.3.16" @@ -801,28 +801,30 @@ version = "1.6.0" dependencies = [ "clap 2.26.0 (registry+https://github.com/rust-lang/crates.io-index)", "download 0.4.0", - "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.53 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", "markdown 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "rustup-dist 1.6.0", "rustup-mock 1.6.0", "rustup-utils 1.6.0", "scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "wait-timeout 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -834,7 +836,7 @@ dependencies = [ name = "rustup-dist" version = "1.6.0" dependencies = [ - "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -847,7 +849,7 @@ dependencies = [ "sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -861,14 +863,11 @@ name = "rustup-mock" version = "1.6.0" dependencies = [ "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustup-utils 1.6.0", - "scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "wait-timeout 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -883,19 +882,17 @@ version = "1.6.0" dependencies = [ "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "download 0.4.0", - "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)", "ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "userenv-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -924,7 +921,7 @@ dependencies = [ "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "secur32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -992,6 +989,25 @@ name = "serde" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "serde_derive" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive_internals" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "serde_json" version = "1.0.2" @@ -1062,6 +1078,24 @@ name = "strsim" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "syn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synom" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "take" version = "0.1.0" @@ -1146,7 +1180,7 @@ name = "thread_local" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1224,10 +1258,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.1.30" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1266,6 +1300,11 @@ name = "unicode-width" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unreachable" version = "1.0.0" @@ -1422,7 +1461,7 @@ dependencies = [ "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" "checksum env_proxy 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f190d9208c08f9f0f608d9ba2530620b351d10e4bf2a62ac2292fe63380fbfb7" -"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" +"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" "checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" @@ -1441,8 +1480,7 @@ dependencies = [ "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum ktmw32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f9313a869ff779ae08dd990b75a92dc06aa16d771f41305f7286649cd39a0ee" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" -"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" +"checksum lazy_static 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c9e5e58fa1a4c3b915a561a78a22ee0cac6ab97dca2504428bc1cb074375f8d5" "checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b" "checksum libc 0.2.30 (registry+https://github.com/rust-lang/crates.io-index)" = "2370ca07ec338939e356443dac2296f581453c35fe1e3a3ed06023c49435f915" "checksum libflate 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a2aa04ec0100812d31a5366130ff9e793291787bc31da845bede4a00ea329830" @@ -1476,6 +1514,7 @@ dependencies = [ "checksum pipeline 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d15b6607fa632996eb8a17c9041cb6071cb75ac057abd45dece578723ea8c7c0" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" "checksum psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abcd5d1a07d360e29727f757a9decb3ce8bc6e0efa8969cfaad669a8317a2478" +"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum rand 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb250fd207a4729c976794d03db689c9be1d634ab5a1c9da9492a13d8fecbcdf" "checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" @@ -1499,6 +1538,8 @@ dependencies = [ "checksum semver 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd61b85a0fa777f7fb7c454b9189b2941b110d1385ce84d7f76efdf1606a85" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f7726f29ddf9731b17ff113c461e362c381d9d69433f79de4f3dd572488823e9" +"checksum serde_derive 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1afcaae083fd1c46952a315062326bc9957f182358eb7da03b57ef1c688f7aa9" +"checksum serde_derive_internals 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd381f6d01a6616cdba8530492d453b7761b456ba974e98768a18cad2cd76f58" "checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" "checksum serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce0fd303af908732989354c6f02e05e2e6d597152870f2c6990efb0577137480" "checksum sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d963c78ce367df26d7ea8b8cc655c651b42e8a1e584e869c1e17dae3ccb116a" @@ -1507,6 +1548,8 @@ dependencies = [ "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum socket2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4daf80fcf54186fac4fe049e0b39d36a5cfde69a11a06413e61e77f553cccf9a" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" +"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" "checksum tar 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "281285b717926caa919ad905ef89c63d75805c7d89437fb873100925a53f2b1b" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" @@ -1523,13 +1566,14 @@ dependencies = [ "checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" "checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" "checksum tokio-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d88e411cac1c87e405e4090be004493c5d8072a370661033b1a64ea205ec2e13" -"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796" +"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" "checksum typenum 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a99dc6780ef33c78780b826cf9d2a78840b72cae9474de4bcaf9051e60ebbd" "checksum unicase 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e01da42520092d0cd2d6ac3ae69eb21a22ad43ff195676b86f8c37f487d6b80" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" "checksum unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8083c594e02b8ae1654ae26f0ade5158b119bd88ad0e8227a5d8fcd72407946" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" "checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" diff --git a/Cargo.toml b/Cargo.toml index d4de51980e..387d5bd53f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,24 +34,26 @@ msi-installed = [] rustup-dist = { path = "src/rustup-dist" } rustup-utils = { path = "src/rustup-utils" } download = { path = "src/download" } -error-chain = "0.10" clap = "2.18.0" -regex = "0.2" -url = "1.1.0" -term = "0.4.4" +error-chain = "0.11" itertools = "0.6" -time = "0.1.34" -tempdir = "0.3.4" -tempfile = "2.1.4" libc = "0.2.0" -rand = "0.3.11" markdown = "0.2" -rustc-serialize = "0.3" +rand = "0.3.11" +regex = "0.2" +remove_dir_all = "0.2.0" scopeguard = "0.3" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" sha2 = "0.6.0" -toml = "0.1" +tempdir = "0.3.4" +tempfile = "2.1.4" +term = "0.4.4" +time = "0.1.34" +toml = "0.4" +url = "1.1.0" wait-timeout = "0.1.5" -remove_dir_all = "0.2.0" [target."cfg(windows)".dependencies] winapi = "0.2.8" diff --git a/src/download/Cargo.toml b/src/download/Cargo.toml index 96ba0754e5..0dd951dd1d 100644 --- a/src/download/Cargo.toml +++ b/src/download/Cargo.toml @@ -14,11 +14,11 @@ curl-backend = ["curl"] reqwest-backend = ["reqwest", "env_proxy", "lazy_static"] [dependencies] -error-chain = "0.10" +error-chain = "0.11" url = "1.2" curl = { version = "0.4.6", optional = true } env_proxy = { version = "0.1.1", optional = true } -lazy_static = { version = "0.1", optional = true } +lazy_static = { version = "0.2", optional = true } reqwest = { version = "0.7.3", optional = true } [dev-dependencies] diff --git a/src/rustup-cli/self_update.rs b/src/rustup-cli/self_update.rs index 2408a10b74..42c6d4bda0 100644 --- a/src/rustup-cli/self_update.rs +++ b/src/rustup-cli/self_update.rs @@ -1377,8 +1377,8 @@ pub fn prepare_update() -> Result> { let release_file = tempdir.path().join("release-stable.toml"); try!(utils::download_file(&release_file_url, &release_file, None, &|_| ())); let release_toml_str = try!(utils::read_file("rustup release", &release_file)); - let release_toml = try!(toml::Parser::new(&release_toml_str).parse() - .ok_or(Error::from("unable to parse rustup release file"))); + let release_toml: toml::Value = try!(toml::from_str(&release_toml_str) + .map_err(|_| Error::from("unable to parse rustup release file"))); let schema = try!(release_toml.get("schema-version") .ok_or(Error::from("no schema key in rustup release file"))); let schema = try!(schema.as_str() diff --git a/src/rustup-dist/Cargo.toml b/src/rustup-dist/Cargo.toml index 32add4ca9c..09d21310e3 100644 --- a/src/rustup-dist/Cargo.toml +++ b/src/rustup-dist/Cargo.toml @@ -20,16 +20,16 @@ url = "1.1.0" tar = "0.4.0" flate2 = "0.2.9" xz2 = "0.1.3" -tempdir = "0.3.4" walkdir = "1.0" -toml = "0.1.27" +toml = "0.4" sha2 = "0.6.0" remove_dir_all = "0.2" rustup-utils = { path = "../rustup-utils" } -error-chain = "0.10" +error-chain = "0.11" [dev-dependencies] rustup-mock = { path = "../rustup-mock" } +tempdir = "0.3.4" [target."cfg(windows)".dependencies] winapi = "0.2.8" diff --git a/src/rustup-dist/src/config.rs b/src/rustup-dist/src/config.rs index 639fa447a0..53908586e3 100644 --- a/src/rustup-dist/src/config.rs +++ b/src/rustup-dist/src/config.rs @@ -14,7 +14,7 @@ pub struct Config { } impl Config { - pub fn from_toml(mut table: toml::Table, path: &str) -> Result { + pub fn from_toml(mut table: toml::value::Table, path: &str) -> Result { let version = try!(get_string(&mut table, "config_version", path)); if !SUPPORTED_CONFIG_VERSIONS.contains(&&*version) { return Err(ErrorKind::UnsupportedVersion(version).into()); @@ -29,8 +29,8 @@ impl Config { components: components, }) } - pub fn to_toml(self) -> toml::Table { - let mut result = toml::Table::new(); + pub fn to_toml(self) -> toml::value::Table { + let mut result = toml::value::Table::new(); result.insert("config_version".to_owned(), toml::Value::String(self.config_version)); let components = Self::components_to_toml(self.components); @@ -41,9 +41,7 @@ impl Config { } pub fn parse(data: &str) -> Result { - let mut parser = toml::Parser::new(data); - let value = try!(parser.parse().ok_or_else(move || ErrorKind::Parsing(parser.errors))); - + let value = toml::from_str(data).map_err(ErrorKind::Parsing)?; Self::from_toml(value, "") } @@ -51,7 +49,7 @@ impl Config { toml::Value::Table(self.to_toml()).to_string() } - fn toml_to_components(arr: toml::Array, path: &str) -> Result> { + fn toml_to_components(arr: toml::value::Array, path: &str) -> Result> { let mut result = Vec::new(); for (i, v) in arr.into_iter().enumerate() { @@ -64,8 +62,8 @@ impl Config { Ok(result) } - fn components_to_toml(components: Vec) -> toml::Array { - let mut result = toml::Array::new(); + fn components_to_toml(components: Vec) -> toml::value::Array { + let mut result = toml::value::Array::new(); for v in components { result.push(toml::Value::Table(v.to_toml())); } diff --git a/src/rustup-dist/src/errors.rs b/src/rustup-dist/src/errors.rs index 9ee55e0ae9..b878b1ef8f 100644 --- a/src/rustup-dist/src/errors.rs +++ b/src/rustup-dist/src/errors.rs @@ -92,7 +92,7 @@ error_chain! { } }) } - Parsing(e: Vec) { + Parsing(e: toml::de::Error) { description("error parsing manifest") } UnsupportedVersion(v: String) { diff --git a/src/rustup-dist/src/lib.rs b/src/rustup-dist/src/lib.rs index 276bc26367..ae26f47873 100644 --- a/src/rustup-dist/src/lib.rs +++ b/src/rustup-dist/src/lib.rs @@ -2,7 +2,6 @@ extern crate regex; extern crate itertools; -extern crate tempdir; extern crate walkdir; extern crate toml; extern crate flate2; diff --git a/src/rustup-dist/src/manifest.rs b/src/rustup-dist/src/manifest.rs index 6ea48d7165..5e149984cd 100644 --- a/src/rustup-dist/src/manifest.rs +++ b/src/rustup-dist/src/manifest.rs @@ -63,10 +63,8 @@ pub struct Component { impl Manifest { pub fn parse(data: &str) -> Result { - let mut parser = toml::Parser::new(data); - let value = try!(parser.parse().ok_or_else(move || ErrorKind::Parsing(parser.errors))); - - let manifest = try!(Self::from_toml(value, "")); + let value = toml::from_str(data).map_err(ErrorKind::Parsing)?; + let manifest = Self::from_toml(value, "")?; try!(manifest.validate()); Ok(manifest) @@ -75,7 +73,7 @@ impl Manifest { toml::Value::Table(self.to_toml()).to_string() } - pub fn from_toml(mut table: toml::Table, path: &str) -> Result { + pub fn from_toml(mut table: toml::value::Table, path: &str) -> Result { let version = try!(get_string(&mut table, "manifest-version", path)); if !SUPPORTED_MANIFEST_VERSIONS.contains(&&*version) { return Err(ErrorKind::UnsupportedVersion(version).into()); @@ -87,8 +85,8 @@ impl Manifest { renames: try!(Self::table_to_renames(table, path)), }) } - pub fn to_toml(self) -> toml::Table { - let mut result = toml::Table::new(); + pub fn to_toml(self) -> toml::value::Table { + let mut result = toml::value::Table::new(); result.insert("date".to_owned(), toml::Value::String(self.date)); result.insert("manifest-version".to_owned(), @@ -103,7 +101,7 @@ impl Manifest { result } - fn table_to_packages(table: &mut toml::Table, path: &str) -> Result> { + fn table_to_packages(table: &mut toml::value::Table, path: &str) -> Result> { let mut result = HashMap::new(); let pkg_table = try!(get_table(table, "pkg", path)); @@ -115,15 +113,15 @@ impl Manifest { Ok(result) } - fn packages_to_table(packages: HashMap) -> toml::Table { - let mut result = toml::Table::new(); + fn packages_to_table(packages: HashMap) -> toml::value::Table { + let mut result = toml::value::Table::new(); for (k, v) in packages { result.insert(k, toml::Value::Table(v.to_toml())); } result } - fn table_to_renames(mut table: toml::Table, path: &str) -> Result> { + fn table_to_renames(mut table: toml::value::Table, path: &str) -> Result> { let mut result = HashMap::new(); let rename_table = try!(get_table(&mut table, "rename", path)); @@ -135,10 +133,10 @@ impl Manifest { Ok(result) } - fn renames_to_table(renames: HashMap) -> toml::Table { - let mut result = toml::Table::new(); + fn renames_to_table(renames: HashMap) -> toml::value::Table { + let mut result = toml::value::Table::new(); for (from, to) in renames { - let mut table = toml::Table::new(); + let mut table = toml::value::Table::new(); table.insert("to".to_owned(), toml::Value::String(to)); result.insert(from, toml::Value::Table(table)); } @@ -190,14 +188,14 @@ impl Manifest { } impl Package { - pub fn from_toml(mut table: toml::Table, path: &str) -> Result { + pub fn from_toml(mut table: toml::value::Table, path: &str) -> Result { Ok(Package { version: try!(get_string(&mut table, "version", path)), targets: try!(Self::toml_to_targets(table, path)), }) } - pub fn to_toml(self) -> toml::Table { - let mut result = toml::Table::new(); + pub fn to_toml(self) -> toml::value::Table { + let mut result = toml::value::Table::new(); result.insert("version".to_owned(), toml::Value::String(self.version)); @@ -207,7 +205,7 @@ impl Package { result } - fn toml_to_targets(mut table: toml::Table, path: &str) -> Result { + fn toml_to_targets(mut table: toml::value::Table, path: &str) -> Result { let mut target_table = try!(get_table(&mut table, "target", path)); if let Some(toml::Value::Table(t)) = target_table.remove("*") { @@ -222,8 +220,8 @@ impl Package { Ok(PackageTargets::Targeted(result)) } } - fn targets_to_toml(targets: PackageTargets) -> toml::Table { - let mut result = toml::Table::new(); + fn targets_to_toml(targets: PackageTargets) -> toml::value::Table { + let mut result = toml::value::Table::new(); match targets { PackageTargets::Wildcard(tpkg) => { result.insert("*".to_owned(), toml::Value::Table(tpkg.to_toml())); @@ -268,7 +266,7 @@ impl PackageTargets { } impl TargetedPackage { - pub fn from_toml(mut table: toml::Table, path: &str) -> Result { + pub fn from_toml(mut table: toml::value::Table, path: &str) -> Result { let components = try!(get_array(&mut table, "components", path)); let extensions = try!(get_array(&mut table, "extensions", path)); @@ -293,10 +291,10 @@ impl TargetedPackage { }) } } - pub fn to_toml(self) -> toml::Table { + pub fn to_toml(self) -> toml::value::Table { let extensions = Self::components_to_toml(self.extensions); let components = Self::components_to_toml(self.components); - let mut result = toml::Table::new(); + let mut result = toml::value::Table::new(); if !extensions.is_empty() { result.insert("extensions".to_owned(), toml::Value::Array(extensions)); } @@ -321,7 +319,7 @@ impl TargetedPackage { self.bins.is_some() } - fn toml_to_components(arr: toml::Array, path: &str) -> Result> { + fn toml_to_components(arr: toml::value::Array, path: &str) -> Result> { let mut result = Vec::new(); for (i, v) in arr.into_iter().enumerate() { @@ -333,8 +331,8 @@ impl TargetedPackage { Ok(result) } - fn components_to_toml(components: Vec) -> toml::Array { - let mut result = toml::Array::new(); + fn components_to_toml(components: Vec) -> toml::value::Array { + let mut result = toml::value::Array::new(); for v in components { result.push(toml::Value::Table(v.to_toml())); } @@ -343,7 +341,7 @@ impl TargetedPackage { } impl Component { - pub fn from_toml(mut table: toml::Table, path: &str) -> Result { + pub fn from_toml(mut table: toml::value::Table, path: &str) -> Result { Ok(Component { pkg: try!(get_string(&mut table, "pkg", path)), target: try!(get_string(&mut table, "target", path).map(|s| { @@ -355,8 +353,8 @@ impl Component { })), }) } - pub fn to_toml(self) -> toml::Table { - let mut result = toml::Table::new(); + pub fn to_toml(self) -> toml::value::Table { + let mut result = toml::value::Table::new(); result.insert("target".to_owned(), toml::Value::String( self.target.map(|t| t.to_string()).unwrap_or_else(||"*".to_owned()) )); diff --git a/src/rustup-mock/Cargo.toml b/src/rustup-mock/Cargo.toml index 8d58b13de4..bfbff8be1a 100644 --- a/src/rustup-mock/Cargo.toml +++ b/src/rustup-mock/Cargo.toml @@ -11,16 +11,13 @@ repository = "https://github.com/rust-lang-nursery/rustup.rs" [dependencies] url = "1.1.0" -scopeguard = "0.3.0" lazy_static = "0.2.0" walkdir = "1.0.0" flate2 = "0.2.9" xz2 = "0.1.3" tempdir = "0.3.4" -itertools = "0.6" tar = "0.4.0" -toml = "0.1.27" -rustup-utils = { path = "../rustup-utils" } +toml = "0.4" sha2 = "0.6.0" wait-timeout = "0.1.3" diff --git a/src/rustup-mock/src/dist.rs b/src/rustup-mock/src/dist.rs index 62e745324f..31f576e4ec 100644 --- a/src/rustup-mock/src/dist.rs +++ b/src/rustup-mock/src/dist.rs @@ -255,21 +255,21 @@ impl MockDistServer { } fn write_manifest_v2(&self, channel: &MockChannel, hashes: &HashMap) { - let mut toml_manifest = toml::Table::new(); + let mut toml_manifest = toml::value::Table::new(); toml_manifest.insert(String::from("manifest-version"), toml::Value::String(MOCK_MANIFEST_VERSION.to_owned())); toml_manifest.insert(String::from("date"), toml::Value::String(channel.date.to_owned())); // [pkg.*] - let mut toml_packages = toml::Table::new(); + let mut toml_packages = toml::value::Table::new(); for package in &channel.packages { - let mut toml_package = toml::Table::new(); + let mut toml_package = toml::value::Table::new(); toml_package.insert(String::from("version"), toml::Value::String(package.version.to_owned())); // [pkg.*.target.*] - let mut toml_targets = toml::Table::new(); + let mut toml_targets = toml::value::Table::new(); for target in &package.targets { - let mut toml_target = toml::Table::new(); + let mut toml_target = toml::value::Table::new(); toml_target.insert(String::from("available"), toml::Value::Boolean(target.available)); let package_file_name = if target.target != "*" { @@ -294,9 +294,9 @@ impl MockDistServer { } // [pkg.*.target.*.components.*] - let mut toml_components = toml::Array::new(); + let mut toml_components = toml::value::Array::new(); for component in &target.components { - let mut toml_component = toml::Table::new(); + let mut toml_component = toml::value::Table::new(); toml_component.insert(String::from("pkg"), toml::Value::String(component.name.to_owned())); toml_component.insert(String::from("target"), toml::Value::String(component.target.to_owned())); toml_components.push(toml::Value::Table(toml_component)); @@ -304,9 +304,9 @@ impl MockDistServer { toml_target.insert(String::from("components"), toml::Value::Array(toml_components)); // [pkg.*.target.*.extensions.*] - let mut toml_extensions = toml::Array::new(); + let mut toml_extensions = toml::value::Array::new(); for extension in &target.extensions { - let mut toml_extension = toml::Table::new(); + let mut toml_extension = toml::value::Table::new(); toml_extension.insert(String::from("pkg"), toml::Value::String(extension.name.to_owned())); toml_extension.insert(String::from("target"), toml::Value::String(extension.target.to_owned())); toml_extensions.push(toml::Value::Table(toml_extension)); @@ -321,9 +321,9 @@ impl MockDistServer { } toml_manifest.insert(String::from("pkg"), toml::Value::Table(toml_packages)); - let mut toml_renames = toml::Table::new(); + let mut toml_renames = toml::value::Table::new(); for (from, to) in &channel.renames { - let mut toml_rename = toml::Table::new(); + let mut toml_rename = toml::value::Table::new(); toml_rename.insert(String::from("to"), toml::Value::String(to.to_owned())); toml_renames.insert(from.to_owned(), toml::Value::Table(toml_rename)); } @@ -331,7 +331,7 @@ impl MockDistServer { let manifest_name = format!("dist/channel-rust-{}", channel.name); let ref manifest_path = self.path.join(format!("{}.toml", manifest_name)); - write_file(manifest_path, &toml::encode_str(&toml_manifest)); + write_file(manifest_path, &toml::to_string(&toml_manifest).unwrap()); let ref hash_path = self.path.join(format!("{}.toml.sha256", manifest_name)); create_hash(manifest_path, hash_path); diff --git a/src/rustup-mock/src/lib.rs b/src/rustup-mock/src/lib.rs index b947534e53..ba2761dc60 100644 --- a/src/rustup-mock/src/lib.rs +++ b/src/rustup-mock/src/lib.rs @@ -3,15 +3,12 @@ extern crate url; #[macro_use] extern crate lazy_static; -extern crate scopeguard; extern crate walkdir; extern crate flate2; extern crate xz2; extern crate tempdir; -extern crate itertools; extern crate tar; extern crate toml; -extern crate rustup_utils; extern crate sha2; extern crate wait_timeout; diff --git a/src/rustup-utils/Cargo.toml b/src/rustup-utils/Cargo.toml index 43d48f7bc5..c13fc5a728 100644 --- a/src/rustup-utils/Cargo.toml +++ b/src/rustup-utils/Cargo.toml @@ -13,21 +13,19 @@ license = "MIT OR Apache-2.0" [dependencies] download = { path = "../download" } -error-chain = "0.10" +error-chain = "0.11" libc = "0.2.0" rand = "0.3.11" remove_dir_all = "0.2.0" -rustc-serialize = "0.3.19" scopeguard = "0.3.0" semver = "0.7.0" sha2 = "0.6.0" -toml = "0.1.27" +toml = "0.4" url = "1.1" [target."cfg(windows)".dependencies] advapi32-sys = "0.2.0" kernel32-sys = "0.2.1" -lazy_static = "0.2" ole32-sys = "0.2.0" shell32-sys = "0.1.1" userenv-sys = "0.2.0" diff --git a/src/rustup-utils/src/lib.rs b/src/rustup-utils/src/lib.rs index 5b4f69d129..98973e6564 100644 --- a/src/rustup-utils/src/lib.rs +++ b/src/rustup-utils/src/lib.rs @@ -4,7 +4,6 @@ extern crate rand; extern crate scopeguard; #[macro_use] extern crate error_chain; -extern crate rustc_serialize; extern crate sha2; extern crate url; extern crate toml; @@ -25,9 +24,6 @@ extern crate kernel32; extern crate advapi32; #[cfg(windows)] extern crate userenv; -#[cfg(windows)] -#[macro_use] -extern crate lazy_static; #[cfg(unix)] extern crate libc; diff --git a/src/rustup-utils/src/toml_utils.rs b/src/rustup-utils/src/toml_utils.rs index b4dd3efee5..5da9e6fde2 100644 --- a/src/rustup-utils/src/toml_utils.rs +++ b/src/rustup-utils/src/toml_utils.rs @@ -1,12 +1,12 @@ use toml; use errors::*; -pub fn get_value(table: &mut toml::Table, key: &str, path: &str) -> Result { +pub fn get_value(table: &mut toml::value::Table, key: &str, path: &str) -> Result { table.remove(key).ok_or_else( || format!("missing key: '{}'", path.to_owned() + key).into()) } -pub fn get_string(table: &mut toml::Table, key: &str, path: &str) -> Result { +pub fn get_string(table: &mut toml::value::Table, key: &str, path: &str) -> Result { get_value(table, key, path).and_then(|v| { if let toml::Value::String(s) = v { Ok(s) @@ -16,7 +16,7 @@ pub fn get_string(table: &mut toml::Table, key: &str, path: &str) -> Result Result> { +pub fn get_opt_string(table: &mut toml::value::Table, key: &str, path: &str) -> Result> { if let Ok(v) = get_value(table, key, path) { if let toml::Value::String(s) = v { Ok(Some(s)) @@ -28,7 +28,7 @@ pub fn get_opt_string(table: &mut toml::Table, key: &str, path: &str) -> Result< } } -pub fn get_bool(table: &mut toml::Table, key: &str, path: &str) -> Result { +pub fn get_bool(table: &mut toml::value::Table, key: &str, path: &str) -> Result { get_value(table, key, path).and_then(|v| { if let toml::Value::Boolean(b) = v { Ok(b) @@ -38,7 +38,7 @@ pub fn get_bool(table: &mut toml::Table, key: &str, path: &str) -> Result }) } -pub fn get_opt_bool(table: &mut toml::Table, key: &str, path: &str) -> Result> { +pub fn get_opt_bool(table: &mut toml::value::Table, key: &str, path: &str) -> Result> { if let Ok(v) = get_value(table, key, path) { if let toml::Value::Boolean(b) = v { Ok(Some(b)) @@ -50,7 +50,7 @@ pub fn get_opt_bool(table: &mut toml::Table, key: &str, path: &str) -> Result Result { +pub fn get_table(table: &mut toml::value::Table, key: &str, path: &str) -> Result { if let Some(v) = table.remove(key) { if let toml::Value::Table(t) = v { Ok(t) @@ -58,11 +58,11 @@ pub fn get_table(table: &mut toml::Table, key: &str, path: &str) -> Result Result { +pub fn get_array(table: &mut toml::value::Table, key: &str, path: &str) -> Result { if let Some(v) = table.remove(key) { if let toml::Value::Array(s) = v { Ok(s) @@ -70,6 +70,6 @@ pub fn get_array(table: &mut toml::Table, key: &str, path: &str) -> Result) { + ParsingSettings(e: toml::de::Error) { description("error parsing settings") } RemovingRequiredComponent(t: String, c: Component) { diff --git a/src/rustup/lib.rs b/src/rustup/lib.rs index 8ee636ac44..a6d5c6d94d 100644 --- a/src/rustup/lib.rs +++ b/src/rustup/lib.rs @@ -7,7 +7,9 @@ extern crate error_chain; extern crate url; extern crate regex; extern crate itertools; -extern crate rustc_serialize; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; extern crate tempfile; extern crate time; extern crate toml; diff --git a/src/rustup/settings.rs b/src/rustup/settings.rs index bc08ff104c..5a6b4b5d43 100644 --- a/src/rustup/settings.rs +++ b/src/rustup/settings.rs @@ -168,16 +168,14 @@ impl Settings { } pub fn parse(data: &str) -> Result { - let mut parser = toml::Parser::new(data); - let value = try!(parser.parse().ok_or_else(move || ErrorKind::ParsingSettings(parser.errors))); - + let value = toml::from_str(data).map_err(ErrorKind::ParsingSettings)?; Self::from_toml(value, "") } pub fn stringify(self) -> String { toml::Value::Table(self.to_toml()).to_string() } - pub fn from_toml(mut table: toml::Table, path: &str) -> Result { + pub fn from_toml(mut table: toml::value::Table, path: &str) -> Result { let version = try!(get_string(&mut table, "version", path)); if !SUPPORTED_METADATA_VERSIONS.contains(&&*version) { return Err(ErrorKind::UnknownMetadataVersion(version).into()); @@ -194,8 +192,8 @@ impl Settings { } }) } - pub fn to_toml(self) -> toml::Table { - let mut result = toml::Table::new(); + pub fn to_toml(self) -> toml::value::Table { + let mut result = toml::value::Table::new(); result.insert("version".to_owned(), toml::Value::String(self.version)); @@ -217,7 +215,7 @@ impl Settings { result } - fn table_to_overrides(table: &mut toml::Table, path: &str) -> Result> { + fn table_to_overrides(table: &mut toml::value::Table, path: &str) -> Result> { let mut result = BTreeMap::new(); let pkg_table = try!(get_table(table, "overrides", path)); @@ -230,8 +228,8 @@ impl Settings { Ok(result) } - fn overrides_to_table(overrides: BTreeMap) -> toml::Table { - let mut result = toml::Table::new(); + fn overrides_to_table(overrides: BTreeMap) -> toml::value::Table { + let mut result = toml::value::Table::new(); for (k, v) in overrides { result.insert(k, toml::Value::String(v)); } diff --git a/src/rustup/telemetry.rs b/src/rustup/telemetry.rs index 0461e0e3e0..9a5c040a8e 100644 --- a/src/rustup/telemetry.rs +++ b/src/rustup/telemetry.rs @@ -1,19 +1,19 @@ use errors::*; use time; use rustup_utils::{raw, utils}; -use rustc_serialize::json; +use serde_json; use std::fs; use std::path::PathBuf; -#[derive(RustcDecodable, RustcEncodable, Debug, Clone)] +#[derive(Deserialize, Serialize, Debug, Clone)] pub enum TelemetryEvent { RustcRun { duration_ms: u64, exit_code: i32, errors: Option> }, ToolchainUpdate { toolchain: String, success: bool } , TargetAdd { toolchain: String, target: String, success: bool }, } -#[derive(RustcDecodable, RustcEncodable, Debug)] +#[derive(Deserialize, Serialize, Debug)] pub struct LogMessage { log_time_s: i64, event: TelemetryEvent, @@ -45,7 +45,7 @@ impl Telemetry { event: event, version: LOG_FILE_VERSION }; - let json = json::encode(&ln).unwrap(); + let json = serde_json::to_string(&ln).unwrap(); let filename = format!("log-{}-{:02}-{:02}.json", current_time.tm_year + 1900, current_time.tm_mon + 1, current_time.tm_mday); diff --git a/src/rustup/telemetry_analysis.rs b/src/rustup/telemetry_analysis.rs index 4afc78d52c..343053835f 100644 --- a/src/rustup/telemetry_analysis.rs +++ b/src/rustup/telemetry_analysis.rs @@ -4,11 +4,12 @@ use std::fs::File; use std::io::BufReader; use std::io::BufRead; use std::path::PathBuf; + use itertools::Itertools; +use serde_json; use errors::*; use telemetry::{LogMessage, TelemetryEvent}; -use rustc_serialize::json; pub struct TelemetryAnalysis { telemetry_dir: PathBuf, @@ -144,14 +145,11 @@ impl TelemetryAnalysis { let file = BufReader::new(&f); for line in file.lines() { - use std::result; - use rustc_serialize::json::DecoderError; - let l = line.unwrap(); - let log_message_result: result::Result = json::decode(&l); + let log_message_result = serde_json::from_str(&l); if log_message_result.is_ok() { - let log_message = log_message_result.unwrap(); + let log_message: LogMessage = log_message_result.unwrap(); let event: TelemetryEvent = log_message.get_event(); events.push(event); }