]> git.proxmox.com Git - cargo.git/commitdiff
Migrate to rustc-serialize
authorDavid Davidović <geosoft.corp@gmail.com>
Wed, 24 Dec 2014 02:45:46 +0000 (03:45 +0100)
committerDavid Davidović <geosoft.corp@gmail.com>
Wed, 24 Dec 2014 03:52:40 +0000 (04:52 +0100)
As per rust-lang/rust@b04bc5c, move all Encodable and Decodable deriving
modes to RustcEncodable and RustcDecodable, and also extern the
rustc-serialize crate instead of the former serialize one.

42 files changed:
src/bin/bench.rs
src/bin/build.rs
src/bin/cargo.rs
src/bin/clean.rs
src/bin/config_for_key.rs
src/bin/config_list.rs
src/bin/doc.rs
src/bin/fetch.rs
src/bin/generate_lockfile.rs
src/bin/git_checkout.rs
src/bin/help.rs
src/bin/locate_project.rs
src/bin/login.rs
src/bin/new.rs
src/bin/owner.rs
src/bin/package.rs
src/bin/pkgid.rs
src/bin/publish.rs
src/bin/read_manifest.rs
src/bin/run.rs
src/bin/search.rs
src/bin/test.rs
src/bin/update.rs
src/bin/verify_project.rs
src/bin/version.rs
src/bin/yank.rs
src/cargo/core/dependency.rs
src/cargo/core/manifest.rs
src/cargo/core/package.rs
src/cargo/core/package_id.rs
src/cargo/core/resolver/encode.rs
src/cargo/core/source.rs
src/cargo/lib.rs
src/cargo/ops/lockfile.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/registry.rs
src/cargo/util/config.rs
src/cargo/util/errors.rs
src/cargo/util/hex.rs
src/cargo/util/toml.rs
src/registry/lib.rs
tests/support/registry.rs

index 76eb81c91a871e5a49071ae543578ea4e31ea406..5cefe978c8ce82e3250166df925a0fcfd63a9298 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, CargoError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_no_run: bool,
     flag_package: Option<String>,
index da0c1d4ee7921e8f47ccc05f5189b3ed344d129b..edd100685ec1790d9a5edc2e931384b00be14735 100644 (file)
@@ -6,7 +6,7 @@ use cargo::ops;
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 use cargo::util::{CliResult, CliError};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_package: Option<String>,
     flag_jobs: Option<uint>,
index 64dbe5a647d0cc1a4db7f4b496169303d32f64b2..9a96d646912f199b7caba2cd892f4e455dadf869 100644 (file)
@@ -1,7 +1,7 @@
 #![feature(phase, macro_rules)]
 #![deny(warnings)]
 
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
 #[phase(plugin, link)] extern crate log;
 #[phase(plugin, link)] extern crate cargo;
 
@@ -15,7 +15,7 @@ use cargo::{execute_main_without_stdin, handle_error, shell};
 use cargo::core::MultiShell;
 use cargo::util::{CliError, CliResult};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Flags {
     flag_list: bool,
     flag_verbose: bool,
index 09258b068d180731e7208b709a3abc99ea656c12..56c9cfcb848ab79bb6fc8830e1a6a6e6b69c69ab 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_package: Option<String>,
     flag_target: Option<String>,
index f1092c83e232aa2d4f2f55eeb253c5dd90dbce98..03ee07210769b009f8a064c53408c67f1eeb2440 100644 (file)
@@ -4,13 +4,13 @@ use std::collections::HashMap;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, config};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct ConfigForKeyFlags {
     flag_human: bool,
     flag_key: String,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 struct ConfigOut {
     values: HashMap<String, config::ConfigValue>
 }
index 336bad08f0120182d36215a06aff8e1d5822c330..e7659f51a8bf100edf859e5f37e1c6351700671c 100644 (file)
@@ -4,12 +4,12 @@ use std::collections::HashMap;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, config};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct ConfigListFlags {
     flag_human: bool,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 struct ConfigOut {
     values: HashMap<String, config::ConfigValue>
 }
index 6e835ed51e0359c9d217ae94435c061b7acdf4cb..78be47183772d803edecd105798cbadc9c9bd76b 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_features: Vec<String>,
     flag_jobs: Option<uint>,
index 837abd97f0729bf0a78b0538c813fae3b5329a27..96adca0ba1610d34586e13605daf0ca9cf1f790a 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_manifest_path: Option<String>,
     flag_verbose: bool,
index 0570f2464082821ee5400f875f077a092f6297de..cc44260387457734fec0c2057bbc8d2395314f06 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_manifest_path: Option<String>,
     flag_verbose: bool,
index a42cbbd03fa41b82173f695f85465b46a01169a6..184da359f5d5943146bb70cea8d35c37479152bf 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::source::{Source, SourceId};
 use cargo::sources::git::{GitSource};
 use cargo::util::{Config, CliResult, CliError, human, ToUrl};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_url: String,
     flag_reference: String,
index 492deca726d317ab675a4bacf805e154b9dd25be..d57415b5b190399cffa3963ba80d9bf029c3017c 100644 (file)
@@ -1,7 +1,7 @@
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options;
 
 pub const USAGE: &'static str = "
index 2013977e9814a13fe89a9544ae3f903194bbcfca..dfa6ec5e5e840a0c77aa10a57b14d425674299a5 100644 (file)
@@ -2,7 +2,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, human, Require};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct LocateProjectFlags {
     flag_manifest_path: Option<String>,
 }
@@ -16,7 +16,7 @@ Options:
     -h, --help              Print this message
 ";
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 struct ProjectLocation {
     root: String
 }
index 7e9a3c9a183ee3dc969d05a072386afa3805dd6a..0310f9086aea76dec0925b6c996ff04c7a889f7f 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::{MultiShell, SourceId, Source};
 use cargo::sources::RegistrySource;
 use cargo::util::{CliResult, CliError, Config};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_host: Option<String>,
     arg_token: Option<String>,
index 46416c09b28f71caf2da331ffa3bc2b4988d778c..80f6c5999f96dd4a94820ea1f10bc0532966cc93 100644 (file)
@@ -4,7 +4,7 @@ use cargo::ops;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_verbose: bool,
     flag_bin: bool,
index 4aabdb9f7a34a5a83dd6102bc3579495a19e9376..a4cf36f6564d16de0dbd38ca392028906b985a41 100644 (file)
@@ -2,7 +2,7 @@ use cargo::ops;
 use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     arg_crate: Option<String>,
     flag_token: Option<String>,
index 057d5c90f18707484a95c05ca5147c7dee27de32..dbc91e42c6ec64775ebd63d3b4aced957222df51 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_verbose: bool,
     flag_manifest_path: Option<String>,
index b126462aaecdd89f689489f6b5512b168f0e127d..8cb91e0ae4be184dd1231a350a90a9710e6a59dc 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_verbose: bool,
     flag_manifest_path: Option<String>,
index 54bc57d3271afe1a0f7e2b6ee8c649294640cf2e..07e1625de4b0aad859003d215fb57398b8b038e4 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_host: Option<String>,
     flag_token: Option<String>,
index ea2fe2204f11dd03a67f33c4a8c31274b6666bfc..03a85f850c3a9fa5122709725fd6b8c938d58c16 100644 (file)
@@ -2,7 +2,7 @@ use cargo::core::{MultiShell, Package, Source};
 use cargo::util::{CliResult, CliError};
 use cargo::sources::{PathSource};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_manifest_path: String,
 }
index 98fde6e09a2f8fadcb08366ae14dfe9fb8c7f1dd..29265d49d3ab29ed257eb10b30837a38ab95deed 100644 (file)
@@ -6,7 +6,7 @@ use cargo::core::manifest::TargetKind;
 use cargo::util::{CliResult, CliError, human};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_bin: Option<String>,
     flag_example: Option<String>,
index 95d01bc309a4ccf606d18326d6e215cd2eaa92f5..706100112ae53d86c51e0013fcbb8696899ea8c2 100644 (file)
@@ -2,7 +2,7 @@ use cargo::ops;
 use cargo::core::{MultiShell};
 use cargo::util::{CliResult, CliError};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     flag_host: Option<String>,
     flag_verbose: bool,
index bcae35f2a01a7823cbd62005da2560e588203c98..15b517a4fc243fefeef3c429e61025a3a51eedf1 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError, CargoError};
 use cargo::util::important_paths::{find_root_manifest_for_cwd};
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     arg_args: Vec<String>,
     flag_features: Vec<String>,
index fdcb1c57a26b3664e25d5dbb37b5c7f9911535d7..47596ba74a18e382035bbdaf9d0bc2279a507aff 100644 (file)
@@ -5,7 +5,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     arg_spec: Option<String>,
     flag_package: Option<String>,
index 06dab62e1893d0409971b36068d00e7ba3ebf229..4bd04adfa578bd3b322d4d18a1f42d7713197dce 100644 (file)
@@ -9,7 +9,7 @@ use cargo::util::CliResult;
 
 pub type Error = HashMap<String, String>;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Flags {
     flag_manifest_path: String,
     flag_verbose: bool,
index 68bb46a3139f9c5e53d2fa5164538d34f3383e98..02fcb0cff9d33fdfbb50eb39ef8f5726d5fdb926 100644 (file)
@@ -4,7 +4,7 @@ use cargo;
 use cargo::core::MultiShell;
 use cargo::util::CliResult;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options;
 
 pub const USAGE: &'static str = "
index f3dc4fd652537e232fc3ab4b628a982fd8c2b161..2103f69c82843d2eb3031d8bc786dc4bfee1f941 100644 (file)
@@ -3,7 +3,7 @@ use cargo::core::MultiShell;
 use cargo::util::{CliResult, CliError};
 use cargo::util::important_paths::find_root_manifest_for_cwd;
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct Options {
     arg_crate: Option<String>,
     flag_token: Option<String>,
index 67c8a0a02047d4e54fc3b9ec3539f1cfbf94aeb8..76e9f97c6fcb7e47596b012cd6adc9f5d9421817 100644 (file)
@@ -184,7 +184,7 @@ impl Dependency {
     }
 }
 
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
 pub struct SerializedDependency {
     name: String,
     req: String
index 51c16ff27965ab3046bfbe508824532d205a6230..2953001a73ea7133859d576e4d688f3272b63942 100644 (file)
@@ -2,7 +2,7 @@ use std::hash;
 use std::fmt::{mod, Show, Formatter};
 
 use semver::Version;
-use serialize::{Encoder,Encodable};
+use rustc_serialize::{Encoder,Encodable};
 
 use core::{Dependency, PackageId, Summary};
 use core::package_id::Metadata;
@@ -53,7 +53,7 @@ pub struct ManifestMetadata {
     pub documentation: Option<String>,  // url
 }
 
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
 pub struct SerializedManifest {
     name: String,
     version: String,
@@ -81,7 +81,7 @@ impl<E, S: Encoder<E>> Encodable<S, E> for Manifest {
     }
 }
 
-#[deriving(Show, Clone, PartialEq, Hash, Encodable, Copy)]
+#[deriving(Show, Clone, PartialEq, Hash, RustcEncodable, Copy)]
 pub enum LibKind {
     Lib,
     Rlib,
@@ -116,14 +116,14 @@ impl LibKind {
     }
 }
 
-#[deriving(Show, Clone, Hash, PartialEq, Encodable)]
+#[deriving(Show, Clone, Hash, PartialEq, RustcEncodable)]
 pub enum TargetKind {
     Lib(Vec<LibKind>),
     Bin,
     Example,
 }
 
-#[deriving(Encodable, Decodable, Clone, PartialEq, Show)]
+#[deriving(RustcEncodable, RustcDecodable, Clone, PartialEq, Show)]
 pub struct Profile {
     env: String, // compile, test, dev, bench, etc.
     opt_level: uint,
@@ -360,7 +360,7 @@ pub struct Target {
     metadata: Option<Metadata>,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 pub struct SerializedTarget {
     kind: Vec<&'static str>,
     name: String,
index 594f685cb820d16dd8fbdf2049bc6c9eb5d8c295..d7e732c9c59d37ccc523d5b670100dd40792cbb7 100644 (file)
@@ -13,7 +13,7 @@ use core::{
 };
 use core::dependency::SerializedDependency;
 use util::{CargoResult, graph};
-use serialize::{Encoder,Encodable};
+use rustc_serialize::{Encoder,Encodable};
 use core::source::{SourceId, Source};
 
 /// Informations about a package that is available somewhere in the file system.
@@ -30,7 +30,7 @@ pub struct Package {
     source_id: SourceId,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 struct SerializedPackage {
     name: String,
     version: String,
index f763d8ccc538710492d118813145c5c315ab7d19..acb341131aa1edf2d5f135692511e38dcf194b5a 100644 (file)
@@ -3,7 +3,7 @@ use std::hash::Hash;
 use std::sync::Arc;
 use std::fmt::{mod, Show, Formatter};
 use std::hash;
-use serialize::{Encodable, Encoder, Decodable, Decoder};
+use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
 
 use regex::Regex;
 
@@ -99,7 +99,7 @@ impl CargoError for PackageIdError {
     fn is_human(&self) -> bool { true }
 }
 
-#[deriving(PartialEq, Hash, Clone, Encodable)]
+#[deriving(PartialEq, Hash, Clone, RustcEncodable)]
 pub struct Metadata {
     pub metadata: String,
     pub extra_filename: String
index cd12897e6efe647d1c3901c18096484e2b32a44a..47bb005d7ee0cfde1fadb3b28dd90ab8e55cd8e0 100644 (file)
@@ -1,14 +1,14 @@
 use std::collections::{HashMap, BTreeMap};
 
 use regex::Regex;
-use serialize::{Encodable, Encoder, Decodable, Decoder};
+use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
 
 use core::{PackageId, SourceId};
 use util::{CargoResult, Graph};
 
 use super::Resolve;
 
-#[deriving(Encodable, Decodable, Show)]
+#[deriving(RustcEncodable, RustcDecodable, Show)]
 pub struct EncodableResolve {
     package: Option<Vec<EncodableDependency>>,
     root: EncodableDependency,
@@ -76,7 +76,7 @@ impl EncodableResolve {
     }
 }
 
-#[deriving(Encodable, Decodable, Show, PartialOrd, Ord, PartialEq, Eq)]
+#[deriving(RustcEncodable, RustcDecodable, Show, PartialOrd, Ord, PartialEq, Eq)]
 pub struct EncodableDependency {
     name: String,
     version: String,
index e2347b19d78a75cc165cb218e085f0d0abd2d68c..5dbd498ea20bf81f21d34ad05ad063d6996d23b2 100644 (file)
@@ -1,9 +1,9 @@
-use std::collections::hash_map::{HashMap, Values, MutEntries};
+use std::collections::hash_map::{HashMap, Values, IterMut};
 use std::fmt::{mod, Show, Formatter};
 use std::hash;
 use std::mem;
 use std::sync::Arc;
-use serialize::{Decodable, Decoder, Encodable, Encoder};
+use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
 
 use url::Url;
 
@@ -42,7 +42,7 @@ pub trait Source: Registry {
     fn fingerprint(&self, pkg: &Package) -> CargoResult<String>;
 }
 
-#[deriving(Encodable, Decodable, Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[deriving(RustcEncodable, RustcDecodable, Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 enum Kind {
     /// Kind::Git(<git reference>) represents a git repository
     Git(String),
index 360e3279038cb66eb67419877bac28fa2419855a..f277cd6a09b3e7c77e15ee0d287ca93d68d90172 100644 (file)
@@ -7,8 +7,8 @@
 #![cfg_attr(test, deny(warnings))]
 
 extern crate libc;
+extern crate "rustc-serialize" as rustc_serialize;
 extern crate regex;
-extern crate serialize;
 extern crate term;
 extern crate time;
 #[phase(plugin, link)] extern crate log;
@@ -29,7 +29,8 @@ extern crate registry;
 use std::os;
 use std::io::stdio::{stdout_raw, stderr_raw};
 use std::io::{mod, stdout, stderr};
-use serialize::{Decoder, Encoder, Decodable, Encodable, json};
+use rustc_serialize::{Decoder, Encoder, Decodable, Encodable};
+use rustc_serialize::json;
 use docopt::Docopt;
 
 use core::{Shell, MultiShell, ShellConfig};
index 5b914e4f1562fed6612e595cca69646a1e24d97b..b5a8414b0e448e13bd1e24c7973910b5bd71e70f 100644 (file)
@@ -1,6 +1,6 @@
 use std::io::File;
 
-use serialize::{Encodable, Decodable};
+use rustc_serialize::{Encodable, Decodable};
 use toml::{mod, Encoder, Value};
 
 use core::{Resolve, resolver, Package, SourceId};
index 5631af7f44fd716457998a137808f42807ceacab..0e7b3afeddb3ecdd490e3751661d64d07e2c8f94 100644 (file)
@@ -1,19 +1,19 @@
 use std::fmt::{mod, Show, Formatter};
 use std::io::{USER_DIR};
 use std::io::fs::{mkdir_recursive, rmdir_recursive, PathExtensions};
-use serialize::{Encodable, Encoder};
+use rustc_serialize::{Encodable, Encoder};
 use url::Url;
 use git2;
 
 use util::{CargoResult, ChainError, human, ToUrl, internal, Require};
 
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
 pub enum GitReference {
     Master,
     Other(String)
 }
 
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
 pub struct GitRevision(String);
 
 impl GitReference {
@@ -61,7 +61,7 @@ pub struct GitRemote {
     url: Url,
 }
 
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
 struct EncodableGitRemote {
     url: String,
 }
@@ -82,7 +82,7 @@ pub struct GitDatabase {
     repo: git2::Repository,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 pub struct EncodableGitDatabase {
     remote: GitRemote,
     path: String,
@@ -107,7 +107,7 @@ pub struct GitCheckout<'a> {
     repo: git2::Repository,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 pub struct EncodableGitCheckout {
     database: EncodableGitDatabase,
     location: String,
index 6566b88fb0642f926eea2ff53560367ab4fd5431..c42a41c2da270722c9aea1250b2f270373ade15f 100644 (file)
@@ -165,8 +165,8 @@ use std::collections::HashMap;
 use curl::http;
 use git2;
 use flate2::reader::GzDecoder;
-use serialize::json;
-use serialize::hex::ToHex;
+use rustc_serialize::json;
+use rustc_serialize::hex::ToHex;
 use tar::Archive;
 use url::Url;
 
@@ -192,7 +192,7 @@ pub struct RegistrySource<'a, 'b:'a> {
     updated: bool,
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub struct RegistryConfig {
     /// Download endpoint for all crates. This will be appended with
     /// `/<crate>/<version>/download` and then will be hit with an HTTP GET
@@ -204,7 +204,7 @@ pub struct RegistryConfig {
     pub api: String,
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct RegistryPackage {
     name: String,
     vers: String,
@@ -214,7 +214,7 @@ struct RegistryPackage {
     yanked: Option<bool>,
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct RegistryDependency {
     name: String,
     req: String,
index 8d000b6413cec9c69563f49a474ca8ef9515e771..27fa2c1d778d47c317b85749a0da654d9cad48dd 100644 (file)
@@ -6,7 +6,7 @@ use std::io;
 use std::io::fs::{mod, PathExtensions, File};
 use std::string;
 
-use serialize::{Encodable,Encoder};
+use rustc_serialize::{Encodable,Encoder};
 use toml;
 use core::MultiShell;
 use ops;
@@ -94,13 +94,13 @@ impl<'a> Config<'a> {
     }
 }
 
-#[deriving(Eq, PartialEq, Clone, Encodable, Decodable, Copy)]
+#[deriving(Eq, PartialEq, Clone, RustcEncodable, RustcDecodable, Copy)]
 pub enum Location {
     Project,
     Global
 }
 
-#[deriving(Eq,PartialEq,Clone,Decodable)]
+#[deriving(Eq,PartialEq,Clone,RustcDecodable)]
 pub enum ConfigValue {
     String(string::String, Path),
     List(Vec<(string::String, Path)>),
index 32fcf1e879b62bf4a922b1345b76b752feec74eb..c33b7f1a7589bd4969899a188737fb1bbbd8cafe 100644 (file)
@@ -2,7 +2,7 @@ use std::io::process::{ProcessOutput, ProcessExit, ExitStatus, ExitSignal};
 use std::io::IoError;
 use std::fmt::{mod, Show, Formatter};
 use std::str;
-use serialize::json;
+use rustc_serialize::json;
 use semver;
 
 use curl;
index dc1f9d611c2e6d7990e95cfa352053461dd57176..005dac91ee5a8f25f94e6b022b0ac6fa9109785b 100644 (file)
@@ -2,7 +2,7 @@ use std::io::MemWriter;
 use std::hash::{Hasher, Hash};
 use std::hash::sip::SipHasher;
 
-use serialize::hex::ToHex;
+use rustc_serialize::hex::ToHex;
 
 pub fn to_hex(num: u64) -> String {
     let mut writer = MemWriter::with_capacity(8);
index 762e32d1346247079838ddec923cea581ff85fe3..a74cb1d80d87df72ff8ab582813e192dde8cb275 100644 (file)
@@ -7,7 +7,7 @@ use std::str;
 use std::default::Default;
 use toml;
 use semver;
-use serialize::{Decodable, Decoder};
+use rustc_serialize::{Decodable, Decoder};
 
 use core::SourceId;
 use core::{Summary, Manifest, Target, Dependency, PackageId};
@@ -181,14 +181,14 @@ type TomlBenchTarget = TomlTarget;
  * TODO: Make all struct fields private
  */
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub enum TomlDependency {
     Simple(String),
     Detailed(DetailedTomlDependency)
 }
 
 
-#[deriving(Decodable, Clone, Default)]
+#[deriving(RustcDecodable, Clone, Default)]
 pub struct DetailedTomlDependency {
     version: Option<String>,
     path: Option<String>,
@@ -201,7 +201,7 @@ pub struct DetailedTomlDependency {
     default_features: Option<bool>,
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub struct TomlManifest {
     package: Option<Box<TomlProject>>,
     project: Option<Box<TomlProject>>,
@@ -218,7 +218,7 @@ pub struct TomlManifest {
     target: Option<HashMap<String, TomlPlatform>>,
 }
 
-#[deriving(Decodable, Clone, Default)]
+#[deriving(RustcDecodable, Clone, Default)]
 pub struct TomlProfiles {
     test: Option<TomlProfile>,
     doc: Option<TomlProfile>,
@@ -227,7 +227,7 @@ pub struct TomlProfiles {
     release: Option<TomlProfile>,
 }
 
-#[deriving(Decodable, Clone, Default)]
+#[deriving(RustcDecodable, Clone, Default)]
 #[allow(missing_copy_implementations)]
 pub struct TomlProfile {
     opt_level: Option<uint>,
@@ -237,7 +237,7 @@ pub struct TomlProfile {
     rpath: Option<bool>,
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub enum ManyOrOne<T> {
     Many(Vec<T>),
     One(T),
@@ -252,7 +252,7 @@ impl<T> ManyOrOne<T> {
     }
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub struct TomlProject {
     name: String,
     version: TomlVersion,
@@ -273,7 +273,7 @@ pub struct TomlProject {
 }
 
 // TODO: deprecated, remove
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub enum BuildCommand {
     Single(String),
     Multiple(Vec<String>)
@@ -604,7 +604,7 @@ fn process_dependencies<'a>(cx: &mut Context<'a>,
     Ok(())
 }
 
-#[deriving(Decodable, Show, Clone)]
+#[deriving(RustcDecodable, Show, Clone)]
 struct TomlTarget {
     name: String,
     crate_type: Option<Vec<String>>,
@@ -617,14 +617,14 @@ struct TomlTarget {
     harness: Option<bool>,
 }
 
-#[deriving(Decodable, Clone)]
+#[deriving(RustcDecodable, Clone)]
 enum PathValue {
     String(String),
     Path(Path),
 }
 
 /// Corresponds to a `target` entry, but `TomlTarget` is already used.
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 struct TomlPlatform {
     dependencies: Option<HashMap<String, TomlDependency>>,
 }
index d875768085cef347a7247ad483f8f9d96dd2053e..75cc5a6d2580338b50c04930e2c37e013ce3f976 100644 (file)
@@ -1,5 +1,5 @@
 extern crate curl;
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
 
 use std::fmt;
 use std::io::{mod, fs, MemReader, MemWriter, File};
@@ -10,7 +10,8 @@ use std::result;
 use curl::http;
 use curl::http::handle::Method::{Put, Get, Delete};
 use curl::http::handle::{Method, Request};
-use serialize::json;
+use rustc_serialize::json;
+
 
 pub struct Registry {
     host: String,
@@ -36,14 +37,14 @@ pub enum Error {
     Io(io::IoError),
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub struct Crate {
     pub name: String,
     pub description: Option<String>,
     pub max_version: String
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 pub struct NewCrate {
     pub name: String,
     pub vers: String,
@@ -60,7 +61,7 @@ pub struct NewCrate {
     pub repository: Option<String>,
 }
 
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
 pub struct NewCrateDependency {
     pub optional: bool,
     pub default_features: bool,
@@ -71,7 +72,7 @@ pub struct NewCrateDependency {
     pub kind: String,
 }
 
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
 pub struct User {
     pub id: uint,
     pub login: String,
@@ -80,12 +81,12 @@ pub struct User {
     pub name: Option<String>,
 }
 
-#[deriving(Decodable)] struct R { ok: bool }
-#[deriving(Decodable)] struct ApiErrorList { errors: Vec<ApiError> }
-#[deriving(Decodable)] struct ApiError { detail: String }
-#[deriving(Encodable)] struct OwnersReq<'a> { users: &'a [&'a str] }
-#[deriving(Decodable)] struct Users { users: Vec<User> }
-#[deriving(Decodable)] struct Crates { crates: Vec<Crate> }
+#[deriving(RustcDecodable)] struct R { ok: bool }
+#[deriving(RustcDecodable)] struct ApiErrorList { errors: Vec<ApiError> }
+#[deriving(RustcDecodable)] struct ApiError { detail: String }
+#[deriving(RustcEncodable)] struct OwnersReq<'a> { users: &'a [&'a str] }
+#[deriving(RustcDecodable)] struct Users { users: Vec<User> }
+#[deriving(RustcDecodable)] struct Crates { crates: Vec<Crate> }
 
 impl Registry {
     pub fn new(host: String, token: Option<String>) -> Registry {
index 3fd6cf091a57f187f0dc5dcfa6833e5673df1c21..3fac53dcb33e5916df25688b64781265b69950b6 100644 (file)
@@ -3,7 +3,7 @@ use std::io::{mod, fs, File};
 use flate2::CompressionLevel::Default;
 use flate2::writer::GzEncoder;
 use git2;
-use serialize::hex::ToHex;
+use rustc_serialize::hex::ToHex;
 use tar::Archive;
 use url::Url;