From 5f9307f97f2b485230151f701c42d62f2512aaed Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Sat, 24 Jun 2017 21:30:51 +0300 Subject: [PATCH 1/3] Drop rustc-serialize dependency --- Cargo.lock | 20 +++- Cargo.toml | 2 +- src/badge.rs | 2 +- src/bin/fill-in-user-id.rs | 5 +- src/category.rs | 14 +-- src/dependency.rs | 2 +- src/download.rs | 2 +- src/git.rs | 12 +-- src/http.rs | 10 +- src/keyword.rs | 8 +- src/krate.rs | 54 +++++----- src/lib.rs | 3 +- src/owner.rs | 12 +-- src/s3/Cargo.toml | 2 +- src/s3/lib.rs | 6 +- src/tests/all.rs | 31 +++--- src/tests/category.rs | 8 +- src/tests/keyword.rs | 6 +- src/tests/krate.rs | 66 +++++++----- src/tests/record.rs | 10 +- src/tests/token.rs | 6 +- src/tests/user.rs | 13 +-- src/tests/version.rs | 9 +- src/token.rs | 18 ++-- src/upload.rs | 209 ++++++++++++++++++++----------------- src/user/mod.rs | 18 ++-- src/util/errors.rs | 7 +- src/util/mod.rs | 20 ++-- src/version.rs | 36 +++---- 29 files changed, 335 insertions(+), 276 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d167693c96..9a9adb4c8d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,9 +2,9 @@ name = "cargo-registry-s3" version = "0.1.0" dependencies = [ + "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -52,6 +52,15 @@ dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "bitflags" version = "0.7.0" @@ -99,6 +108,7 @@ dependencies = [ "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "license-exprs 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "oauth2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -108,7 +118,6 @@ dependencies = [ "r2d2-diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2_postgres 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -858,6 +867,11 @@ name = "rustc-serialize" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "safemem" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "scheduled-thread-pool" version = "0.1.0" @@ -1107,6 +1121,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" "checksum backtrace 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f551bc2ddd53aea015d453ef0b635af89444afa5ed2405dd0b2062ad5d600d80" "checksum backtrace-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d192fd129132fbc97497c1f2ec2c2c5174e376b95f535199ef4fe0a293d33842" +"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" @@ -1198,6 +1213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum route-recognizer 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3255338088df8146ba63d60a9b8e3556f1146ce2973bc05a75181a42ce2256" "checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" "checksum scheduled-thread-pool 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d9fbe48ead32343b76f544c85953bf260ed39219a8bbbb62cd85f6a00f9644f" "checksum semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae2ff60ecdb19c255841c066cbfa5f8c2a4ada1eb3ae47c77ab6667128da71f5" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" diff --git a/Cargo.toml b/Cargo.toml index 835ade34b5a..85d1508cf14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ curl = "0.4" oauth2 = "0.3" log = "0.3" env_logger = "0.4" -rustc-serialize = "0.3" +hex = "0.2" license-exprs = "^1.3" dotenv = "0.10.0" toml = "0.2" diff --git a/src/badge.rs b/src/badge.rs index bdbcea7fe11..7ad6d765ccb 100644 --- a/src/badge.rs +++ b/src/badge.rs @@ -44,7 +44,7 @@ pub enum Badge { }, } -#[derive(RustcEncodable, RustcDecodable, PartialEq, Debug, Deserialize)] +#[derive(PartialEq, Debug, Serialize, Deserialize)] pub struct EncodableBadge { pub badge_type: String, pub attributes: HashMap>, diff --git a/src/bin/fill-in-user-id.rs b/src/bin/fill-in-user-id.rs index d3a907a2ca1..037de4ee159 100644 --- a/src/bin/fill-in-user-id.rs +++ b/src/bin/fill-in-user-id.rs @@ -10,7 +10,8 @@ extern crate cargo_registry; extern crate git2; extern crate postgres; -extern crate rustc_serialize; +#[macro_use] +extern crate serde_derive; use std::path::PathBuf; @@ -44,7 +45,7 @@ fn main() { } } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct GithubUser { login: String, id: i32, diff --git a/src/category.rs b/src/category.rs index 90a8839bc70..21e4045b9ee 100644 --- a/src/category.rs +++ b/src/category.rs @@ -35,7 +35,7 @@ pub struct CrateCategory { category_id: i32, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableCategory { pub id: String, pub category: String, @@ -45,7 +45,7 @@ pub struct EncodableCategory { pub crates_cnt: i32, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableCategoryWithSubcategories { pub id: String, pub category: String, @@ -343,12 +343,12 @@ pub fn index(req: &mut Request) -> CargoResult { // Query for the total count of categories let total = Category::count_toplevel(conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { categories: Vec, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { total: i64, } @@ -379,7 +379,7 @@ pub fn show(req: &mut Request) -> CargoResult { subcategories: subcats, }; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { category: EncodableCategoryWithSubcategories, } @@ -395,7 +395,7 @@ pub fn slugs(req: &mut Request) -> CargoResult { )?; let rows = stmt.query(&[])?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Slug { id: String, slug: String, @@ -411,7 +411,7 @@ pub fn slugs(req: &mut Request) -> CargoResult { }) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { category_slugs: Vec, } diff --git a/src/dependency.rs b/src/dependency.rs index a7f1fab5747..5a15b8b9d4f 100644 --- a/src/dependency.rs +++ b/src/dependency.rs @@ -34,7 +34,7 @@ pub struct ReverseDependency { crate_downloads: i32, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableDependency { pub id: i32, pub version_id: i32, diff --git a/src/download.rs b/src/download.rs index 2aa8aa97b4f..ee23da452dd 100644 --- a/src/download.rs +++ b/src/download.rs @@ -26,7 +26,7 @@ struct NewVersionDownload( i32 ); -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableVersionDownload { pub id: i32, pub version: i32, diff --git a/src/git.rs b/src/git.rs index 70eed7a9ee3..d2294cc1e27 100644 --- a/src/git.rs +++ b/src/git.rs @@ -6,13 +6,13 @@ use std::path::{Path, PathBuf}; use semver; use git2; -use rustc_serialize::json; +use serde_json; use app::App; use dependency::Kind; use util::{CargoResult, internal}; -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct Crate { pub name: String, pub vers: String, @@ -22,7 +22,7 @@ pub struct Crate { pub yanked: Option, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct Dependency { pub name: String, pub req: String, @@ -60,7 +60,7 @@ pub fn add_crate(app: &App, krate: &Crate) -> CargoResult<()> { |mut f| f.read_to_string(&mut prev), )?; } - let s = json::encode(krate).unwrap(); + let s = serde_json::to_string(krate).unwrap(); let new = prev + &s; let mut f = File::create(&dst)?; f.write_all(new.as_bytes())?; @@ -85,14 +85,14 @@ pub fn yank(app: &App, krate: &str, version: &semver::Version, yanked: bool) -> )?; let new = prev.lines() .map(|line| { - let mut git_crate = json::decode::(line).map_err(|_| { + let mut git_crate = serde_json::from_str::(line).map_err(|_| { internal(&format_args!("couldn't decode: `{}`", line)) })?; if git_crate.name != krate || git_crate.vers != version.to_string() { return Ok(line.to_string()); } git_crate.yanked = Some(yanked); - Ok(json::encode(&git_crate).unwrap()) + Ok(serde_json::to_string(&git_crate).unwrap()) }) .collect::>>(); let new = new?.join("\n"); diff --git a/src/http.rs b/src/http.rs index 7d153a8dac3..9d8714ecddd 100644 --- a/src/http.rs +++ b/src/http.rs @@ -3,7 +3,8 @@ use curl::easy::{Easy, List}; use oauth2::*; use app::App; use util::{CargoResult, internal, ChainError, human}; -use rustc_serialize::{json, Decodable}; +use serde_json; +use serde::Deserialize; use std::str; @@ -43,7 +44,10 @@ pub fn github(app: &App, url: &str, auth: &Token) -> Result<(Easy, Vec), cur } /// Checks for normal responses -pub fn parse_github_response(mut resp: Easy, data: &[u8]) -> CargoResult { +pub fn parse_github_response<'de, 'a: 'de, T: Deserialize<'de>>( + mut resp: Easy, + data: &'a [u8], +) -> CargoResult { match resp.response_code().unwrap() { 200 => {} // Ok! 403 => { @@ -72,7 +76,7 @@ pub fn parse_github_response(mut resp: Easy, data: &[u8]) -> Cargo internal("github didn't send a utf8-response") })?; - json::decode(json).chain_error(|| internal("github didn't send a valid json response")) + serde_json::from_str(json).chain_error(|| internal("github didn't send a valid json response")) } /// Gets a token with the given string as the access token, but all diff --git a/src/keyword.rs b/src/keyword.rs index 0606fbc6f9c..0ab7032fb19 100644 --- a/src/keyword.rs +++ b/src/keyword.rs @@ -31,7 +31,7 @@ pub struct CrateKeyword { keyword_id: i32, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableKeyword { pub id: String, pub keyword: String, @@ -165,12 +165,12 @@ pub fn index(req: &mut Request) -> CargoResult { .map(|(k, _)| k.encodable()) .collect::>(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { keywords: Vec, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { total: i64, } @@ -188,7 +188,7 @@ pub fn show(req: &mut Request) -> CargoResult { let kw = Keyword::find_by_keyword(&conn, name)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { keyword: EncodableKeyword, } diff --git a/src/krate.rs b/src/krate.rs index 87c0db5ad60..ff41b393f87 100644 --- a/src/krate.rs +++ b/src/krate.rs @@ -14,8 +14,8 @@ use diesel_full_text_search::*; use license_exprs; use pg::GenericConnection; use pg::rows::Row; -use rustc_serialize::hex::ToHex; -use rustc_serialize::json; +use hex::ToHex; +use serde_json; use semver; use time::Timespec; use url::Url; @@ -88,7 +88,7 @@ pub const MAX_NAME_LENGTH: usize = 64; type CrateQuery<'a> = crates::BoxedQuery<'a, Pg, ::SqlType>; -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableCrate { pub id: String, pub name: String, @@ -109,7 +109,7 @@ pub struct EncodableCrate { pub exact_match: bool, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct CrateLinks { pub version_downloads: String, pub versions: Option, @@ -917,12 +917,12 @@ pub fn index(req: &mut Request) -> CargoResult { }) .collect::>()?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { crates: Vec, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { total: i64, } @@ -987,7 +987,7 @@ pub fn summary(req: &mut Request) -> CargoResult { .map(Category::encodable) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { num_downloads: i64, num_crates: i64, @@ -1032,7 +1032,7 @@ pub fn show(req: &mut Request) -> CargoResult { )?; let max_version = krate.max_version(&conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { krate: EncodableCrate, versions: Vec, @@ -1173,7 +1173,7 @@ pub fn new(req: &mut Request) -> CargoResult { // Now that we've come this far, we're committed! bomb.path = None; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Warnings<'a> { invalid_categories: Vec<&'a str>, invalid_badges: Vec<&'a str>, @@ -1183,7 +1183,7 @@ pub fn new(req: &mut Request) -> CargoResult { invalid_badges: ignored_invalid_badges, }; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R<'a> { krate: EncodableCrate, warnings: Warnings<'a>, @@ -1207,7 +1207,7 @@ fn parse_new_headers(req: &mut Request) -> CargoResult<(upload::NewCrate, User)> let json = String::from_utf8(json).map_err(|_| { human("json body was not valid utf-8") })?; - let new: upload::NewCrate = json::decode(&json).map_err(|e| { + let new: upload::NewCrate = serde_json::from_str(&json).map_err(|e| { human(&format_args!("invalid upload request: {:?}", e)) })?; @@ -1261,7 +1261,7 @@ pub fn download(req: &mut Request) -> CargoResult { .ok_or_else(|| human("crate files not found"))?; if req.wants_json() { - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { url: String, } @@ -1319,17 +1319,17 @@ pub fn downloads(req: &mut Request) -> CargoResult { .order(version_downloads::date.asc()) .load::(&*conn)?; - #[derive(RustcEncodable, Queryable)] + #[derive(Serialize, Queryable)] struct ExtraDownload { date: String, downloads: i64, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { version_downloads: Vec, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { extra_downloads: Vec, } @@ -1367,7 +1367,7 @@ pub fn follow(req: &mut Request) -> CargoResult { diesel::insert(&follow.on_conflict_do_nothing()) .into(follows::table) .execute(&*conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { ok: bool, } @@ -1379,7 +1379,7 @@ pub fn unfollow(req: &mut Request) -> CargoResult { let follow = follow_target(req)?; let conn = req.db_conn()?; diesel::delete(&follow).execute(&*conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { ok: bool, } @@ -1394,7 +1394,7 @@ pub fn following(req: &mut Request) -> CargoResult { let conn = req.db_conn()?; let following = diesel::select(exists(follows::table.find(follow.id()))) .get_result(&*conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { following: bool, } @@ -1414,7 +1414,7 @@ pub fn versions(req: &mut Request) -> CargoResult { .map(|v| v.encodable(crate_name)) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { versions: Vec, } @@ -1432,7 +1432,7 @@ pub fn owners(req: &mut Request) -> CargoResult { .map(Owner::encodable) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { users: Vec, } @@ -1449,7 +1449,7 @@ pub fn owner_team(req: &mut Request) -> CargoResult { .map(Owner::encodable) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { teams: Vec, } @@ -1466,7 +1466,7 @@ pub fn owner_user(req: &mut Request) -> CargoResult { .map(Owner::encodable) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { users: Vec, } @@ -1503,14 +1503,14 @@ fn modify_owners(req: &mut Request, add: bool) -> CargoResult { } } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Request { // identical, for back-compat (owners preferred) users: Option>, owners: Option>, } - let request: Request = json::decode(&body).map_err( + let request: Request = serde_json::from_str(&body).map_err( |_| human("invalid json request"), )?; @@ -1534,7 +1534,7 @@ fn modify_owners(req: &mut Request, add: bool) -> CargoResult { } } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { ok: bool, } @@ -1566,13 +1566,13 @@ pub fn reverse_dependencies(req: &mut Request) -> CargoResult { .map(|(version, krate_name)| version.encodable(&krate_name)) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { dependencies: Vec, versions: Vec, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { total: i64, } diff --git a/src/lib.rs b/src/lib.rs index 5bcaefd2852..426c4183a83 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ extern crate diesel_full_text_search; extern crate dotenv; extern crate flate2; extern crate git2; +extern crate hex; extern crate license_exprs; extern crate oauth2; extern crate openssl; @@ -31,9 +32,9 @@ extern crate r2d2; extern crate r2d2_diesel; extern crate r2d2_postgres; extern crate rand; -extern crate rustc_serialize; extern crate s3; extern crate semver; +extern crate serde; extern crate time; extern crate toml; extern crate url; diff --git a/src/owner.rs b/src/owner.rs index dac60e36c0e..38563a6ac8a 100644 --- a/src/owner.rs +++ b/src/owner.rs @@ -37,7 +37,7 @@ pub enum Owner { /// For now, just a Github Team. Can be upgraded to other teams /// later if desirable. -#[derive(Queryable, Identifiable, RustcEncodable, RustcDecodable, Debug)] +#[derive(Queryable, Identifiable, Serialize, Deserialize, Debug)] pub struct Team { /// Unique table id pub id: i32, @@ -53,7 +53,7 @@ pub struct Team { pub avatar: Option, } -#[derive(RustcEncodable, Debug)] +#[derive(Serialize, Debug)] pub struct EncodableTeam { pub id: i32, pub login: String, @@ -62,7 +62,7 @@ pub struct EncodableTeam { pub url: Option, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableOwner { pub id: i32, pub login: String, @@ -179,7 +179,7 @@ impl Team { ))); } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct GithubTeam { slug: String, // the name we want to find id: i32, // unique GH id (needed for membership queries) @@ -208,7 +208,7 @@ impl Team { return Err(human("only members of a team can add it as an owner")); } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Org { avatar_url: Option, } @@ -275,7 +275,7 @@ fn team_with_gh_id_contains_user(app: &App, github_id: i32, user: &User) -> Carg // GET teams/:team_id/memberships/:user_name // check that "state": "active" - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Membership { state: String, } diff --git a/src/s3/Cargo.toml b/src/s3/Cargo.toml index 839343a19e1..b86e2351348 100644 --- a/src/s3/Cargo.toml +++ b/src/s3/Cargo.toml @@ -16,4 +16,4 @@ path = "lib.rs" openssl = "0.9" time = "0.1.0" curl = "0.4" -rustc-serialize = "0.3" +base64 = "0.6" diff --git a/src/s3/lib.rs b/src/s3/lib.rs index af76f77b852..e333453f325 100644 --- a/src/s3/lib.rs +++ b/src/s3/lib.rs @@ -1,8 +1,8 @@ #![deny(warnings)] +extern crate base64; extern crate time; extern crate curl; -extern crate rustc_serialize; extern crate openssl; use std::io::prelude::*; @@ -11,7 +11,7 @@ use curl::easy::{Easy, Transfer, List, ReadError}; use openssl::hash::MessageDigest; use openssl::sign::Signer; use openssl::pkey::PKey; -use rustc_serialize::base64::{ToBase64, STANDARD}; +use base64::{encode}; #[derive(Clone, Debug)] pub struct Bucket { @@ -119,7 +119,7 @@ impl Bucket { let key = PKey::hmac(self.secret_key.as_bytes()).unwrap(); let mut signer = Signer::new(MessageDigest::sha1(), &key).unwrap(); signer.update(string.as_bytes()).unwrap(); - signer.finish().unwrap().to_base64(STANDARD) + encode(&signer.finish().unwrap()[..]) }; format!("AWS {}:{}", self.access_key, signature) } diff --git a/src/tests/all.rs b/src/tests/all.rs index b93af52ad38..308d13825df 100644 --- a/src/tests/all.rs +++ b/src/tests/all.rs @@ -1,5 +1,7 @@ #![deny(warnings)] +#[macro_use] +extern crate serde_derive; extern crate diesel; extern crate bufstream; extern crate cargo_registry; @@ -10,13 +12,14 @@ extern crate curl; extern crate dotenv; extern crate git2; extern crate postgres; -extern crate rustc_serialize; extern crate semver; +extern crate serde; +extern crate serde_json; extern crate time; extern crate url; extern crate s3; -use rustc_serialize::json::{self, Json}; +use serde_json::Value; use std::borrow::Cow; use std::collections::HashMap; use std::env; @@ -72,11 +75,11 @@ macro_rules! bad_resp { }) } -#[derive(RustcDecodable, Debug)] +#[derive(Deserialize, Debug)] struct Error { detail: String, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct Bad { errors: Vec, } @@ -157,26 +160,28 @@ fn bad_resp(r: &mut conduit::Response) -> Option { Some(bad) } -fn json(r: &mut conduit::Response) -> T { +fn json(r: &mut conduit::Response) -> T +where + for<'de> T: serde::Deserialize<'de>, +{ let mut data = Vec::new(); r.body.write_body(&mut data).unwrap(); let s = std::str::from_utf8(&data).unwrap(); - let j = match Json::from_str(s) { + let j = match serde_json::from_str(s) { Ok(t) => t, Err(e) => panic!("failed to decode: {:?}\n{}", e, s), }; let j = fixup(j); - let s = j.to_string(); - return match json::decode(&s) { + return match serde_json::from_value::(j) { Ok(t) => t, Err(e) => panic!("failed to decode: {:?}\n{}", e, s), }; - fn fixup(json: Json) -> Json { + fn fixup(json: Value) -> Value { match json { - Json::Object(object) => { - Json::Object( + Value::Object(object) => { + Value::Object( object .into_iter() .map(|(k, v)| { @@ -186,7 +191,7 @@ fn json(r: &mut conduit::Response) -> T { .collect(), ) } - Json::Array(list) => Json::Array(list.into_iter().map(fixup).collect()), + Value::Array(list) => Value::Array(list.into_iter().map(fixup).collect()), j => j, } } @@ -662,7 +667,7 @@ fn new_req_body( } fn new_crate_to_body(new_crate: &u::NewCrate, krate: &[u8]) -> Vec { - let json = json::encode(&new_crate).unwrap(); + let json = serde_json::to_string(&new_crate).unwrap(); let mut body = Vec::new(); body.extend( [ diff --git a/src/tests/category.rs b/src/tests/category.rs index 511b0b2c131..4966ec3f5a2 100644 --- a/src/tests/category.rs +++ b/src/tests/category.rs @@ -4,20 +4,20 @@ use conduit_test::MockRequest; use cargo_registry::db::RequestTransaction; use cargo_registry::category::{Category, EncodableCategory, EncodableCategoryWithSubcategories}; -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct CategoryList { categories: Vec, meta: CategoryMeta, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct CategoryMeta { total: i32, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct GoodCategory { category: EncodableCategory, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct CategoryWithSubcategories { category: EncodableCategoryWithSubcategories, } diff --git a/src/tests/keyword.rs b/src/tests/keyword.rs index 980615800d9..75a3f8a09d8 100644 --- a/src/tests/keyword.rs +++ b/src/tests/keyword.rs @@ -3,16 +3,16 @@ use conduit_test::MockRequest; use cargo_registry::keyword::{Keyword, EncodableKeyword}; -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct KeywordList { keywords: Vec, meta: KeywordMeta, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct KeywordMeta { total: i32, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct GoodKeyword { keyword: EncodableKeyword, } diff --git a/src/tests/krate.rs b/src/tests/krate.rs index d84589b478c..7d48d60aacf 100644 --- a/src/tests/krate.rs +++ b/src/tests/krate.rs @@ -7,71 +7,73 @@ use std::fs::{self, File}; use conduit::{Handler, Method}; use git2; -use rustc_serialize::json; use self::diesel::prelude::*; +use serde_json; use semver; -use cargo_registry::category::Category; use cargo_registry::dependency::EncodableDependency; use cargo_registry::download::EncodableVersionDownload; use cargo_registry::git; use cargo_registry::keyword::EncodableKeyword; use cargo_registry::krate::{Crate, EncodableCrate, MAX_NAME_LENGTH}; + use cargo_registry::token::ApiToken; use cargo_registry::owner::EncodableOwner; use cargo_registry::schema::versions; + use cargo_registry::upload as u; use cargo_registry::user::EncodableUser; use cargo_registry::version::EncodableVersion; +use cargo_registry::category::Category; -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct CrateList { crates: Vec, meta: CrateMeta, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct VersionsList { versions: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct CrateMeta { total: i32, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct Warnings { invalid_categories: Vec, invalid_badges: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct GoodCrate { krate: EncodableCrate, warnings: Warnings, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct CrateResponse { krate: EncodableCrate, versions: Vec, keywords: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct Deps { dependencies: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct RevDeps { dependencies: Vec, versions: Vec, meta: CrateMeta, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct Downloads { version_downloads: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct TeamResponse { teams: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct UserResponse { users: Vec, } @@ -458,7 +460,9 @@ fn new_bad_names() { ::mock_user(&mut req, ::user("foo")); let json = bad_resp!(middle.call(&mut req)); assert!( - json.errors[0].detail.contains("invalid crate name"), + json.errors[0].detail.contains( + "expected a valid crate name", + ), "{:?}", json.errors ); @@ -558,7 +562,7 @@ fn new_krate_with_dependency() { .unwrap() .read_to_string(&mut contents) .unwrap(); - let p: git::Crate = json::decode(&contents).unwrap(); + let p: git::Crate = serde_json::from_str(&contents).unwrap(); assert_eq!(p.name, "new_dep"); assert_eq!(p.vers, "1.0.0"); assert_eq!(p.deps.len(), 1); @@ -671,7 +675,9 @@ fn new_krate_bad_name() { ::sign_in(&mut req, &app); let json = bad_resp!(middle.call(&mut req)); assert!( - json.errors[0].detail.contains("invalid crate name"), + json.errors[0].detail.contains( + "expected a valid crate name", + ), "{:?}", json.errors ); @@ -681,7 +687,9 @@ fn new_krate_bad_name() { ::sign_in(&mut req, &app); let json = bad_resp!(middle.call(&mut req)); assert!( - json.errors[0].detail.contains("invalid crate name"), + json.errors[0].detail.contains( + "expected a valid crate name", + ), "{:?}", json.errors ); @@ -690,7 +698,7 @@ fn new_krate_bad_name() { #[test] fn new_crate_owner() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct O { ok: bool, } @@ -875,7 +883,7 @@ fn new_krate_git_upload() { .unwrap() .read_to_string(&mut contents) .unwrap(); - let p: git::Crate = json::decode(&contents).unwrap(); + let p: git::Crate = serde_json::from_str(&contents).unwrap(); assert_eq!(p.name, "fgt"); assert_eq!(p.vers, "1.0.0"); assert!(p.deps.is_empty()); @@ -909,8 +917,8 @@ fn new_krate_git_upload_appends() { .read_to_string(&mut contents) .unwrap(); let mut lines = contents.lines(); - let p1: git::Crate = json::decode(lines.next().unwrap().trim()).unwrap(); - let p2: git::Crate = json::decode(lines.next().unwrap().trim()).unwrap(); + let p1: git::Crate = serde_json::from_str(lines.next().unwrap().trim()).unwrap(); + let p2: git::Crate = serde_json::from_str(lines.next().unwrap().trim()).unwrap(); assert!(lines.next().is_none()); assert_eq!(p1.name, "FPP"); assert_eq!(p1.vers, "0.0.1"); @@ -1108,11 +1116,11 @@ fn diesel_not_found_results_in_404() { #[test] fn following() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct F { following: bool, } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct O { ok: bool, } @@ -1175,11 +1183,11 @@ fn following() { #[test] fn owners() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct R { users: Vec, } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct O { ok: bool, } @@ -1237,11 +1245,11 @@ fn owners() { #[test] fn yank() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct O { ok: bool, } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct V { version: EncodableVersion, } @@ -1313,7 +1321,7 @@ fn yank_not_owner() { #[test] fn yank_max_version() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct O { ok: bool, } @@ -1409,7 +1417,7 @@ fn yank_max_version() { #[test] fn publish_after_yank_max_version() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct O { ok: bool, } diff --git a/src/tests/record.rs b/src/tests/record.rs index de0d26a869f..a9144b20b4c 100644 --- a/src/tests/record.rs +++ b/src/tests/record.rs @@ -15,7 +15,7 @@ use std::thread; use bufstream::BufStream; use cargo_registry::user::NewUser; use curl::easy::{Easy, List, ReadError}; -use rustc_serialize::json; +use serde_json; // A "bomb" so when the test task exists we know when to shut down // the server and fail if the subtask failed. @@ -313,7 +313,7 @@ impl GhUser { } let password = ::env(&format!("GH_PASS_{}", self.login.replace("-", "_"))); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Authorization { scopes: Vec, note: String, @@ -326,7 +326,7 @@ impl GhUser { self.login, password ); - let body = json::encode(&Authorization { + let body = serde_json::to_string(&Authorization { scopes: vec!["read:org".to_string()], note: "crates.io test".to_string(), client_id: ::env("GH_CLIENT_ID"), @@ -358,11 +358,11 @@ impl GhUser { panic!("failed to get a 200 {}", String::from_utf8_lossy(&response)); } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Response { token: String, } - let resp: Response = json::decode(str::from_utf8(&response).unwrap()).unwrap(); + let resp: Response = serde_json::from_str(str::from_utf8(&response).unwrap()).unwrap(); File::create(&self.filename()) .unwrap() .write_all(&resp.token.as_bytes()) diff --git a/src/tests/token.rs b/src/tests/token.rs index e3323e0b1cb..d1ccb6f846f 100644 --- a/src/tests/token.rs +++ b/src/tests/token.rs @@ -4,15 +4,15 @@ use conduit::{Handler, Method}; use cargo_registry::token::{ApiToken, EncodableApiToken, EncodableApiTokenWithToken}; -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct ListResponse { api_tokens: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct NewResponse { api_token: EncodableApiTokenWithToken, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct RevokedResponse {} macro_rules! assert_contains { diff --git a/src/tests/user.rs b/src/tests/user.rs index dd8e9bc8a80..7feae3593b4 100644 --- a/src/tests/user.rs +++ b/src/tests/user.rs @@ -10,12 +10,13 @@ use cargo_registry::version::EncodableVersion; use diesel::prelude::*; -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct AuthResponse { url: String, state: String, } -#[derive(RustcDecodable)] + +#[derive(Deserialize)] pub struct UserShowResponse { pub user: EncodableUser, } @@ -114,7 +115,7 @@ fn crates_by_user_id() { req.with_query(&format!("user_id={}", u.id)); let mut response = ok_resp!(middle.call(&mut req)); - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Response { crates: Vec, } @@ -124,12 +125,12 @@ fn crates_by_user_id() { #[test] fn following() { - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct R { versions: Vec, meta: Meta, } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Meta { more: bool, } @@ -241,7 +242,7 @@ fn user_total_downloads() { let mut req = ::req(app, Method::Get, &format!("/api/v1/users/{}/stats", u.id)); let mut response = ok_resp!(middle.call(&mut req)); - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct Response { total_downloads: i64, } diff --git a/src/tests/version.rs b/src/tests/version.rs index cf1df296a6f..bc5478b5ff8 100644 --- a/src/tests/version.rs +++ b/src/tests/version.rs @@ -1,6 +1,7 @@ extern crate diesel; +extern crate serde_json; -use rustc_serialize::json::Json; +use serde_json::Value; use conduit::{Handler, Method}; use self::diesel::prelude::*; @@ -8,11 +9,11 @@ use self::diesel::prelude::*; use cargo_registry::version::EncodableVersion; use cargo_registry::schema::versions; -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct VersionList { versions: Vec, } -#[derive(RustcDecodable)] +#[derive(Deserialize)] struct VersionResponse { version: EncodableVersion, } @@ -80,7 +81,7 @@ fn authors() { let mut data = Vec::new(); response.body.write_body(&mut data).unwrap(); let s = ::std::str::from_utf8(&data).unwrap(); - let json = Json::from_str(&s).unwrap(); + let json: Value = serde_json::from_str(&s).unwrap(); let json = json.as_object().unwrap(); assert!(json.contains_key(&"users".to_string())); } diff --git a/src/token.rs b/src/token.rs index 99e399e9deb..8b47559af31 100644 --- a/src/token.rs +++ b/src/token.rs @@ -4,7 +4,7 @@ use diesel::pg::PgConnection; use conduit::{Request, Response}; use time::Timespec; use conduit_router::RequestParams; -use rustc_serialize::json; +use serde_json as json; use db::RequestTransaction; use user::{RequestUser, AuthenticationSource}; @@ -23,8 +23,8 @@ pub struct ApiToken { } /// The serialization format for the `ApiToken` model without its token value. -#[derive(RustcDecodable, RustcEncodable)] pub struct EncodableApiToken { +#[derive(Deserialize, Serialize)] pub id: i32, pub name: String, pub created_at: String, @@ -34,8 +34,8 @@ pub struct EncodableApiToken { /// The serialization format for the `ApiToken` model with its token value. /// This should only be used when initially creating a new token to minimize /// the chance of token leaks. -#[derive(RustcDecodable, RustcEncodable)] pub struct EncodableApiTokenWithToken { +#[derive(Deserialize, Serialize)] pub id: i32, pub name: String, pub token: String, @@ -120,7 +120,7 @@ pub fn list(req: &mut Request) -> CargoResult { .into_iter() .map(ApiToken::encodable) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { api_tokens: Vec, } @@ -130,13 +130,13 @@ pub fn list(req: &mut Request) -> CargoResult { /// Handles the `POST /me/tokens` route. pub fn new(req: &mut Request) -> CargoResult { /// The incoming serialization format for the `ApiToken` model. - #[derive(RustcDecodable, RustcEncodable)] + #[derive(Deserialize, Serialize)] struct NewApiToken { name: String, } /// The incoming serialization format for the `ApiToken` model. - #[derive(RustcDecodable, RustcEncodable)] + #[derive(Deserialize, Serialize)] struct NewApiTokenRequest { api_token: NewApiToken, } @@ -163,7 +163,7 @@ pub fn new(req: &mut Request) -> CargoResult { bad_request(&"json body was not valid utf-8") })?; - let new: NewApiTokenRequest = json::decode(&json).map_err(|e| { + let new: NewApiTokenRequest = json::from_str(&json).map_err(|e| { bad_request(&format!("invalid new token request: {:?}", e)) })?; @@ -185,7 +185,7 @@ pub fn new(req: &mut Request) -> CargoResult { let api_token = ApiToken::insert(&*req.db_conn()?, user.id, name)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { api_token: EncodableApiTokenWithToken, } @@ -201,7 +201,7 @@ pub fn revoke(req: &mut Request) -> CargoResult { ApiToken::delete(&*req.db_conn()?, user.id, id)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R {} Ok(req.json(&R {})) } diff --git a/src/upload.rs b/src/upload.rs index a58f3ab0057..475d15b56fe 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -1,14 +1,14 @@ use std::collections::HashMap; use std::ops::Deref; -use rustc_serialize::{Decodable, Decoder, Encoder, Encodable}; +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use semver; use dependency::Kind as DependencyKind; use keyword::Keyword as CrateKeyword; use krate::{Crate, MAX_NAME_LENGTH}; -#[derive(RustcDecodable, RustcEncodable, Debug)] +#[derive(Deserialize, Serialize, Debug)] pub struct NewCrate { pub name: CrateName, pub vers: CrateVersion, @@ -44,7 +44,7 @@ pub struct Category(pub String); #[derive(Debug)] pub struct Feature(pub String); -#[derive(RustcDecodable, RustcEncodable, Debug)] +#[derive(Deserialize, Serialize, Debug)] pub struct CrateDependency { pub optional: bool, pub default_features: bool, @@ -55,20 +55,20 @@ pub struct CrateDependency { pub kind: Option, } -impl Decodable for CrateName { - fn decode(d: &mut D) -> Result { - let s = d.read_str()?; +impl<'de> Deserialize<'de> for CrateName { + fn deserialize>(d: D) -> Result { + let s = String::deserialize(d)?; if !Crate::valid_name(&s) { - return Err(d.error(&format!( - "invalid crate name specified: {}. \ - Valid crate names must start with a letter; contain only \ - letters, numbers, hyphens, or underscores; and have {} or \ - fewer characters.", - s, + let value = de::Unexpected::Str(&s); + let expected = format!( + "a valid crate name to start with a letter, contain only letters, \ + numbers, hyphens, or underscores and have at most {} characters", MAX_NAME_LENGTH - ))); + ); + Err(de::Error::invalid_value(value, &expected.as_ref())) + } else { + Ok(CrateName(s)) } - Ok(CrateName(s)) } } @@ -81,48 +81,62 @@ where } } -impl Decodable for Keyword { - fn decode(d: &mut D) -> Result { - let s = d.read_str()?; +impl<'de> Deserialize<'de> for Keyword { + fn deserialize>(d: D) -> Result { + let s = String::deserialize(d)?; if !CrateKeyword::valid_name(&s) { - return Err(d.error(&format!("invalid keyword specified: {}", s))); + let value = de::Unexpected::Str(&s); + let expected = "a valid keyword specifier"; + Err(de::Error::invalid_value(value, &expected)) + } else { + Ok(Keyword(s)) } - Ok(Keyword(s)) } } -impl Decodable for Category { - fn decode(d: &mut D) -> Result { - d.read_str().map(Category) +impl<'de> Deserialize<'de> for Category { + fn deserialize>(d: D) -> Result { + String::deserialize(d).map(Category) } } -impl Decodable for Feature { - fn decode(d: &mut D) -> Result { - let s = d.read_str()?; +impl<'de> Deserialize<'de> for Feature { + fn deserialize>(d: D) -> Result { + let s = String::deserialize(d)?; if !Crate::valid_feature_name(&s) { - return Err(d.error(&format!("invalid feature name specified: {}", s))); + let value = de::Unexpected::Str(&s); + let expected = "a valid feature name"; + Err(de::Error::invalid_value(value, &expected)) + } else { + Ok(Feature(s)) } - Ok(Feature(s)) } } -impl Decodable for CrateVersion { - fn decode(d: &mut D) -> Result { - let s = d.read_str()?; +impl<'de> Deserialize<'de> for CrateVersion { + fn deserialize>(d: D) -> Result { + let s = String::deserialize(d)?; match semver::Version::parse(&s) { Ok(v) => Ok(CrateVersion(v)), - Err(..) => Err(d.error(&format!("invalid semver: {}", s))), + Err(..) => { + let value = de::Unexpected::Str(&s); + let expected = "a valid semver"; + Err(de::Error::invalid_value(value, &expected)) + } } } } -impl Decodable for CrateVersionReq { - fn decode(d: &mut D) -> Result { - let s = d.read_str()?; +impl<'de> Deserialize<'de> for CrateVersionReq { + fn deserialize>(d: D) -> Result { + let s = String::deserialize(d)?; match semver::VersionReq::parse(&s) { Ok(v) => Ok(CrateVersionReq(v)), - Err(..) => Err(d.error(&format!("invalid version req: {}", s))), + Err(..) => { + let value = de::Unexpected::Str(&s); + let expected = "a valid version req"; + Err(de::Error::invalid_value(value, &expected)) + } } } } @@ -136,108 +150,115 @@ where } } -impl Decodable for KeywordList { - fn decode(d: &mut D) -> Result { - let inner: Vec = Decodable::decode(d)?; +impl<'de> Deserialize<'de> for KeywordList { + fn deserialize>(d: D) -> Result { + let inner = as Deserialize<'de>>::deserialize(d)?; if inner.len() > 5 { - return Err(d.error("a maximum of 5 keywords per crate are allowed")); + let expected = "at most 5 keywords per crate"; + return Err(de::Error::invalid_length(inner.len(), &expected)); } for val in &inner { if val.len() > 20 { - return Err(d.error( - "keywords must contain less than 20 \ - characters", - )); + let expected = "a keyword with less than 20 characters"; + return Err(de::Error::invalid_length(val.len(), &expected)); } } Ok(KeywordList(inner)) } } -impl Decodable for CategoryList { - fn decode(d: &mut D) -> Result { - let inner: Vec = Decodable::decode(d)?; +impl<'de> Deserialize<'de> for CategoryList { + fn deserialize>(d: D) -> Result { + let inner = as Deserialize<'de>>::deserialize(d)?; if inner.len() > 5 { - return Err(d.error("a maximum of 5 categories per crate are allowed")); + let expected = "at most 5 categories per crate"; + Err(de::Error::invalid_length(inner.len(), &expected)) + } else { + Ok(CategoryList(inner)) } - Ok(CategoryList(inner)) } } -impl Decodable for DependencyKind { - fn decode(d: &mut D) -> Result { - let s: String = Decodable::decode(d)?; +impl<'de> Deserialize<'de> for DependencyKind { + fn deserialize>(d: D) -> Result { + let s = String::deserialize(d)?; match &s[..] { "dev" => Ok(DependencyKind::Dev), "build" => Ok(DependencyKind::Build), "normal" => Ok(DependencyKind::Normal), - s => { - Err(d.error(&format!( - "invalid dependency kind `{}`, must be \ - one of dev, build, or normal", - s - ))) + _ => { + const KINDS: &'static [&'static str] = &["dev", "build", "normal"]; + Err(de::Error::unknown_variant(&s, KINDS)) } } } } -impl Encodable for CrateName { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { - d.emit_str(self) - } -} - -impl Encodable for Keyword { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { - d.emit_str(self) - } +macro_rules! serialize_string { + ($name:ty) => ( + impl Serialize for $name { + fn serialize(&self, serializer: S) -> Result + where S: Serializer + { + serializer.serialize_str(self.deref()) + } + } + ) } -impl Encodable for Category { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { - d.emit_str(self) - } -} +serialize_string!(CrateName); +serialize_string!(Keyword); +serialize_string!(Category); +serialize_string!(Feature); -impl Encodable for Feature { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { - d.emit_str(self) - } -} -impl Encodable for CrateVersion { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { - d.emit_str(&(**self).to_string()) +impl Serialize for CrateVersion { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&(**self).to_string()) } } -impl Encodable for CrateVersionReq { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { - d.emit_str(&(**self).to_string()) +impl Serialize for CrateVersionReq { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&(**self).to_string()) } } -impl Encodable for KeywordList { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { +impl Serialize for KeywordList { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { let KeywordList(ref inner) = *self; - inner.encode(d) + inner.serialize(serializer) } } -impl Encodable for CategoryList { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { +impl Serialize for CategoryList { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { let CategoryList(ref inner) = *self; - inner.encode(d) + inner.serialize(serializer) } } -impl Encodable for DependencyKind { - fn encode(&self, d: &mut E) -> Result<(), E::Error> { +impl Serialize for DependencyKind { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { match *self { - DependencyKind::Normal => "normal".encode(d), - DependencyKind::Build => "build".encode(d), - DependencyKind::Dev => "dev".encode(d), + DependencyKind::Normal => "normal".serialize(serializer), + DependencyKind::Build => "build".serialize(serializer), + DependencyKind::Dev => "dev".serialize(serializer), } } } diff --git a/src/user/mod.rs b/src/user/mod.rs index 333d5d24326..8f6bd72779f 100644 --- a/src/user/mod.rs +++ b/src/user/mod.rs @@ -81,7 +81,7 @@ impl<'a> NewUser<'a> { } /// The serialization format for the `User` model. -#[derive(RustcDecodable, RustcEncodable, Debug)] +#[derive(Deserialize, Serialize, Debug)] pub struct EncodableUser { pub id: i32, pub login: String, @@ -239,7 +239,7 @@ pub fn github_authorize(req: &mut Request) -> CargoResult { let url = req.app().github.authorize_url(state.clone()); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { url: String, state: String, @@ -294,7 +294,7 @@ pub fn github_access_token(req: &mut Request) -> CargoResult { } } - #[derive(RustcDecodable)] + #[derive(Deserialize)] struct GithubUser { email: Option, name: Option, @@ -336,7 +336,7 @@ pub fn logout(req: &mut Request) -> CargoResult { /// Handles the `GET /me` route. pub fn me(req: &mut Request) -> CargoResult { - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { user: EncodableUser, } @@ -351,7 +351,7 @@ pub fn show(req: &mut Request) -> CargoResult { let conn = req.db_conn()?; let user = users.filter(gh_login.eq(name)).first::(&*conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { user: EncodableUser, } @@ -368,7 +368,7 @@ pub fn show_team(req: &mut Request) -> CargoResult { let conn = req.db_conn()?; let team = teams.filter(login.eq(name)).first::(&*conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { team: EncodableTeam, } @@ -406,12 +406,12 @@ pub fn updates(req: &mut Request) -> CargoResult { .map(|(version, crate_name, _)| version.encodable(&crate_name)) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { versions: Vec, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { more: bool, } @@ -437,7 +437,7 @@ pub fn stats(req: &mut Request) -> CargoResult { .select(sum(crates::downloads)) .first::(&*conn)?; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { total_downloads: i64, } diff --git a/src/util/errors.rs b/src/util/errors.rs index 2982154b202..fcaece52eae 100644 --- a/src/util/errors.rs +++ b/src/util/errors.rs @@ -7,11 +7,11 @@ use diesel::result::Error as DieselError; use util::json_response; -#[derive(RustcEncodable)] +#[derive(Serialize)] struct StringError { detail: String, } -#[derive(RustcEncodable)] +#[derive(Serialize)] struct Bad { errors: Vec, } @@ -185,7 +185,8 @@ impl CargoError for ::curl::Error { Error::description(self) } } -impl CargoError for ::rustc_serialize::json::DecoderError { + +impl CargoError for ::serde_json::Error { fn description(&self) -> &str { Error::description(self) } diff --git a/src/util/mod.rs b/src/util/mod.rs index 32dfae580f3..5c3cdeb22df 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -3,8 +3,8 @@ use std::error::Error; use std::io::{self, Cursor}; use std::sync::Arc; -use rustc_serialize::{json, Encodable}; -use rustc_serialize::json::Json; +use serde_json::{self, Value}; +use serde::Serialize; use url; use conduit::{Request, Response, Handler}; @@ -30,14 +30,14 @@ mod request_proxy; pub trait RequestUtils { fn redirect(&self, url: String) -> Response; - fn json(&self, t: &T) -> Response; + fn json(&self, t: &T) -> Response; fn query(&self) -> HashMap; fn wants_json(&self) -> bool; fn pagination(&self, default: usize, max: usize) -> CargoResult<(i64, i64)>; } -pub fn json_response(t: &T) -> Response { - let s = json::encode(t).unwrap(); +pub fn json_response(t: &T) -> Response { + let s = serde_json::to_string(t).unwrap(); let json = fixup(s.parse().unwrap()).to_string(); let mut headers = HashMap::new(); headers.insert( @@ -51,10 +51,10 @@ pub fn json_response(t: &T) -> Response { body: Box::new(Cursor::new(json.into_bytes())), }; - fn fixup(json: Json) -> Json { + fn fixup(json: Value) -> Value { match json { - Json::Object(object) => { - Json::Object( + Value::Object(object) => { + Value::Object( object .into_iter() .map(|(k, v)| { @@ -64,7 +64,7 @@ pub fn json_response(t: &T) -> Response { .collect(), ) } - Json::Array(list) => Json::Array(list.into_iter().map(fixup).collect()), + Value::Array(list) => Value::Array(list.into_iter().map(fixup).collect()), j => j, } } @@ -72,7 +72,7 @@ pub fn json_response(t: &T) -> Response { impl<'a> RequestUtils for Request + 'a { - fn json(&self, t: &T) -> Response { + fn json(&self, t: &T) -> Response { json_response(t) } diff --git a/src/version.rs b/src/version.rs index 577a7d184a1..cf60cd8c450 100644 --- a/src/version.rs +++ b/src/version.rs @@ -7,8 +7,8 @@ use diesel::pg::{Pg, PgConnection}; use diesel::prelude::*; use pg::GenericConnection; use pg::rows::Row; -use rustc_serialize::json; use semver; +use serde_json; use time::{Duration, Timespec, now_utc, strptime}; use url; @@ -53,7 +53,7 @@ pub struct Author { pub name: String, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct EncodableVersion { pub id: i32, pub krate: String, @@ -68,7 +68,7 @@ pub struct EncodableVersion { pub links: VersionLinks, } -#[derive(RustcEncodable, RustcDecodable, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct VersionLinks { pub dependencies: String, pub version_downloads: String, @@ -98,7 +98,7 @@ impl Version { authors: &[String], ) -> CargoResult { let num = num.to_string(); - let features = json::encode(features).unwrap(); + let features = serde_json::to_string(features).unwrap(); let stmt = conn.prepare( "INSERT INTO versions \ (crate_id, num, features) \ @@ -215,7 +215,7 @@ impl NewVersion { license: Option, license_file: Option<&str>, ) -> CargoResult { - let features = json::encode(features)?; + let features = serde_json::to_string(features)?; let mut new_version = NewVersion { crate_id: crate_id, @@ -298,9 +298,9 @@ impl Queryable for Version { type Row = (i32, i32, String, Timespec, Timespec, i32, Option, bool, Option); fn build(row: Self::Row) -> Self { - let features = row.6.map(|s| json::decode(&s).unwrap()).unwrap_or_else( - HashMap::new, - ); + let features = row.6 + .map(|s| serde_json::from_str(&s).unwrap()) + .unwrap_or_else(HashMap::new); Version { id: row.0, crate_id: row.1, @@ -319,9 +319,9 @@ impl Model for Version { fn from_row(row: &Row) -> Version { let num: String = row.get("num"); let features: Option = row.get("features"); - let features = features.map(|s| json::decode(&s).unwrap()).unwrap_or_else( - HashMap::new, - ); + let features = features + .map(|s| serde_json::from_str(&s).unwrap()) + .unwrap_or_else(HashMap::new); Version { id: row.get("id"), crate_id: row.get("crate_id"), @@ -364,7 +364,7 @@ pub fn index(req: &mut Request) -> CargoResult { .map(|(version, crate_name)| version.encodable(&crate_name)) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { versions: Vec, } @@ -387,7 +387,7 @@ pub fn show(req: &mut Request) -> CargoResult { } }; - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { version: EncodableVersion, } @@ -443,7 +443,7 @@ pub fn dependencies(req: &mut Request) -> CargoResult { .map(|(dep, crate_name)| dep.encodable(&crate_name, None)) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { dependencies: Vec, } @@ -473,7 +473,7 @@ pub fn downloads(req: &mut Request) -> CargoResult { .map(VersionDownload::encodable) .collect(); - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { version_downloads: Vec, } @@ -489,12 +489,12 @@ pub fn authors(req: &mut Request) -> CargoResult { // It was imagined that we wold associate authors with users. // This was never implemented. This complicated return struct // is all that is left, hear for backwards compatibility. - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { users: Vec<::user::EncodableUser>, meta: Meta, } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct Meta { names: Vec, } @@ -533,7 +533,7 @@ fn modify_yank(req: &mut Request, yanked: bool) -> CargoResult { })?; } - #[derive(RustcEncodable)] + #[derive(Serialize)] struct R { ok: bool, } From d02cf0e01171cbf2b23f8269b76da3ae0f601c9f Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Fri, 30 Jun 2017 14:36:13 +0300 Subject: [PATCH 2/3] Update toml dependency to 0.4 --- Cargo.lock | 7 +++---- Cargo.toml | 2 +- src/categories.rs | 11 +++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a9adb4c8d8..7b2325efdb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,7 +123,7 @@ dependencies = [ "serde_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1032,10 +1032,10 @@ dependencies = [ [[package]] name = "toml" -version = "0.2.1" +version = "0.4.2" 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.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1233,7 +1233,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" "checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7" "checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" -"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" "checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" "checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" "checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" diff --git a/Cargo.toml b/Cargo.toml index 85d1508cf14..5c56f8d4e64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ env_logger = "0.4" hex = "0.2" license-exprs = "^1.3" dotenv = "0.10.0" -toml = "0.2" +toml = "0.4" diesel = { version = "0.13.0", features = ["postgres", "serde_json", "deprecated-time", "chrono"] } diesel_codegen = "0.13.0" r2d2-diesel = "0.13.0" diff --git a/src/categories.rs b/src/categories.rs index 1d5de6ef29b..97885cd9699 100644 --- a/src/categories.rs +++ b/src/categories.rs @@ -39,7 +39,7 @@ impl Category { } } -fn required_string_from_toml<'a>(toml: &'a toml::Table, key: &str) -> CargoResult<&'a str> { +fn required_string_from_toml<'a>(toml: &'a toml::value::Table, key: &str) -> CargoResult<&'a str> { toml.get(key).and_then(toml::Value::as_str).chain_error(|| { internal(&format_args!( "Expected category TOML attribute '{}' to be a String", @@ -48,12 +48,12 @@ fn required_string_from_toml<'a>(toml: &'a toml::Table, key: &str) -> CargoResul }) } -fn optional_string_from_toml<'a>(toml: &'a toml::Table, key: &str) -> &'a str { +fn optional_string_from_toml<'a>(toml: &'a toml::value::Table, key: &str) -> &'a str { toml.get(key).and_then(toml::Value::as_str).unwrap_or("") } fn categories_from_toml( - categories: &toml::Table, + categories: &toml::value::Table, parent: Option<&Category>, ) -> CargoResult> { let mut result = vec![]; @@ -92,9 +92,8 @@ pub fn sync() -> CargoResult<()> { let tx = conn.transaction().unwrap(); let categories = include_str!("./categories.toml"); - let toml = toml::Parser::new(categories).parse().expect( - "Could not parse categories.toml", - ); + let toml: toml::value::Table = + toml::from_str(categories).expect("Could not parse categories.toml"); let categories = categories_from_toml(&toml, None).expect("Could not convert categories from TOML"); From 5ffc714b07f4b66abdcd1d60d4b4c7dba15820ef Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Sat, 1 Jul 2017 04:17:00 +0300 Subject: [PATCH 3/3] Use serde derive where possible --- Cargo.lock | 616 +++++++++++++++++++++++++++------------------ src/dependency.rs | 3 +- src/krate.rs | 2 + src/tests/all.rs | 27 +- src/tests/krate.rs | 2 + src/token.rs | 4 +- src/upload.rs | 87 +------ src/util/mod.rs | 25 +- 8 files changed, 394 insertions(+), 372 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b2325efdb1..d0746ff48f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,8 +3,8 @@ name = "cargo-registry-s3" version = "0.1.0" dependencies = [ "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -31,25 +31,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "backtrace" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "dbghelp-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)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -63,16 +71,16 @@ dependencies = [ [[package]] name = "bitflags" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "bitflags" -version = "0.8.2" +name = "bufstream" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "bufstream" +name = "byte-tools" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -81,13 +89,22 @@ name = "byteorder" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytes" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cargo-registry" version = "0.1.0" dependencies = [ "bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "cargo-registry-s3 0.1.0", - "chrono 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "civet 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.142 (registry+https://github.com/rust-lang/crates.io-index)", "conduit 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -100,31 +117,31 @@ dependencies = [ "conduit-router 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "conduit-static 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "conduit-test 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_codegen 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "diesel_full_text_search 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dotenv 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "license-exprs 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "oauth2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "postgres 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", + "postgres 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2-diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2_postgres 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -132,22 +149,22 @@ name = "cargo_metadata" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cfg-if" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -158,7 +175,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "civet-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "conduit 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -183,22 +200,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itertools 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cmake" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -258,7 +275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "conduit 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "conduit-middleware 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -318,39 +335,55 @@ dependencies = [ "semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "constant_time_eq" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cookie" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "openssl 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crypto-mac" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "constant_time_eq 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl-sys 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", + "socket2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl-sys" -version = "0.3.11" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -365,7 +398,7 @@ dependencies = [ [[package]] name = "derive-error-chain" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -378,8 +411,8 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pq-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pq-sys 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -390,7 +423,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -403,22 +436,39 @@ dependencies = [ "diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "digest" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest-buffer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dotenv" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "dotenv" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "derive-error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "derive-error-chain 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -433,11 +483,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "env_logger" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -445,9 +495,14 @@ name = "error-chain" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fallible-iterator" version = "0.1.3" @@ -458,7 +513,7 @@ name = "filetime" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -466,7 +521,7 @@ name = "flate2" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -477,29 +532,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "gcc" -version = "0.3.45" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "gdi32-sys" -version = "0.2.0" +name = "generic-array" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "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)", + "nodrop 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "git2" -version = "0.6.4" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -508,13 +563,32 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "idna" +name = "hmac" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crypto-mac 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -546,44 +620,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.22" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.6.9" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "curl-sys 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "libssh2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libssh2-sys" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libz-sys" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -593,17 +668,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "log" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "matches" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "md5" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -611,7 +686,7 @@ name = "memchr" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -619,7 +694,7 @@ name = "memchr" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -627,18 +702,26 @@ name = "miniz-sys" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nodrop" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "odds 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -646,7 +729,7 @@ name = "num-integer" version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -655,12 +738,12 @@ version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -668,21 +751,26 @@ name = "oauth2" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "odds" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "openssl" -version = "0.9.11" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -692,16 +780,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl-sys" -version = "0.9.11" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "percent-encoding" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "phf" version = "0.7.21" @@ -725,47 +816,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "postgres" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", - "postgres-protocol 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "postgres-shared 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)", + "postgres-protocol 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "postgres-shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "postgres-protocol" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "md5 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "md5 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "stringprep 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "postgres-shared" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "chrono 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "postgres-protocol 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "postgres-protocol 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pq-sys" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "quine-mc_cluskey" @@ -783,7 +883,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "scheduled-thread-pool 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -801,7 +901,7 @@ name = "r2d2_postgres" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "postgres 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "postgres 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", "r2d2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -810,12 +910,12 @@ name = "rand" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -832,13 +932,13 @@ dependencies = [ [[package]] name = "regex" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -849,7 +949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex-syntax" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -912,27 +1012,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.6" +version = "1.0.9" 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.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.15.1 (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.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -941,24 +1036,25 @@ dependencies = [ [[package]] name = "serde_json" -version = "0.9.10" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "serde_json" -version = "1.0.2" +name = "sha2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "digest-buffer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -966,6 +1062,27 @@ name = "siphasher" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "socket2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "stringprep" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-bidi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "0.11.11" @@ -990,16 +1107,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "thread-id" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1012,11 +1120,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1025,8 +1133,8 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1035,28 +1143,33 @@ name = "toml" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "toml" -version = "0.4.2" +name = "typenum" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-bidi" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-bidi" -version = "0.2.5" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-normalization" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1066,7 +1179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unreachable" -version = "0.1.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1074,20 +1187,12 @@ dependencies = [ [[package]] name = "url" -version = "1.4.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "idna 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "user32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "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)", + "idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1100,6 +1205,11 @@ name = "utf8-ranges" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "vcpkg" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "void" version = "1.0.2" @@ -1115,20 +1225,31 @@ name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "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)", +] + [metadata] "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" -"checksum backtrace 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f551bc2ddd53aea015d453ef0b635af89444afa5ed2405dd0b2062ad5d600d80" -"checksum backtrace-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d192fd129132fbc97497c1f2ec2c2c5174e376b95f535199ef4fe0a293d33842" +"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" +"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" +"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" "checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" -"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" +"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" +"checksum byte-tools 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0919189ba800c7ffe8778278116b7e0de3905ab81c72abb69c85cbfef7991279" "checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" +"checksum bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8b24f16593f445422331a5eed46b72f7f171f910fead4f2ea8f17e727e9c5c14" "checksum cargo_metadata 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5d84cb53c78e573aa126a4b9f963fdb2629f8183b26e235da08bb36dc7381162" -"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" -"checksum chrono 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d9123be86fd2a8f627836c235ecdf331fdd067ecf7ac05aa1a68fbcf2429f056" +"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" +"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" "checksum civet 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6263e7af767a5bf9e4d3d0a6c3ceb5f3940ec85cf2fbfee59024b8a264be180f" "checksum civet-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "958d15372bf28b7983cb35e1d4bf36dd843b0d42e507c1c73aad7150372c5936" "checksum clippy 0.0.142 (registry+https://github.com/rust-lang/crates.io-index)" = "e82a66cfefcffef361a3ba150954563c5a1e151467e8bf4e28551f931200c7e3" @@ -1146,70 +1267,80 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum conduit-static 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c5dadad9ced84acc9f67c778c25cec1c1065d6503d283cc6a1b2a4e545752d51" "checksum conduit-test 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "75684ce3713e1507fbf85796c9e74e7c4c8148bc82bcf823fec83b551189d429" "checksum conduit-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "922a5739a6a262d77a90196f749a06ea45875491ce1657774371a995ecba93b9" +"checksum constant_time_eq 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "07dcb7959f0f6f1cf662f9a7ff389bcb919924d99ac41cf31f10d611d8721323" "checksum cookie 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8d12191219481eb202e05529f646f9af8d1ecfcd53bbf3997d4a4b15ca095cf8" -"checksum curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c90e1240ef340dd4027ade439e5c7c2064dd9dc652682117bd50d1486a3add7b" -"checksum curl-sys 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "23e7e544dc5e1ba42c4a4a678bd47985e84b9c3f4d3404c29700622a029db9c3" +"checksum crypto-mac 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dba62c86c26dcba13c278afcaac0c7452486fe604a2668a0dfa4e0edc98d8a9e" +"checksum curl 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6689276ab61f97c660669a5ecc117c36875dfc1ba301c986b16c653415bdf9d7" +"checksum curl-sys 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d5481162dc4f424d088581db2f979fa7d4c238fe9794595de61d8d7522e277de" "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" -"checksum derive-error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5aa0793c7e314a5c8b4092ed60ce447627eb9790c610fa48d6df4f4f05064039" +"checksum derive-error-chain 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c9ca9ade651388daad7c993f005d0d20c4f6fe78c1cdc93e95f161c6f5ede4a" "checksum diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "90edf3024e90c3bf92ff71c6e9e809648b0e482a653dc006d5639fdc40cd78a3" "checksum diesel_codegen 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb4ee459a5b4a5c7dfd08c573cfa8d922539bcbe0515a8feea0a5d22606f50cb" "checksum diesel_full_text_search 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d97f70b958c54bfc1aa87d62c9593356d4af070d058ab334b6d9859b06e644be" -"checksum dotenv 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f0b6bea196dc1effc0f5184ff71d4df7cc28b81ba81bcfb74b4c633d683ebda" -"checksum dotenv 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eea1395d2df3b5344dc577809296d9578303296e8d105c408aa80ed67d598ef1" +"checksum digest 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a68d759d7a66a4f63d5bd2a2b14ad7e8cf93fe8c9be227031cd4e72ab0e9ee8" +"checksum digest-buffer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4eb92364e9f6d3da159257250532d448b218406d2acb149f724e8f48e9f5cb9a" +"checksum dotenv 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d6f0e2bb24d163428d8031d3ebd2d2bd903ad933205a97d0f18c7c1aade380f3" +"checksum dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "400b347fe65ccfbd8f545c9d9a75d04b0caf23fec49aaa838a9a05398f94c019" "checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" -"checksum env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e3856f1697098606fc6cb97a93de88ca3f3bc35bb878c725920e6e82ecf05e83" +"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5d48ab1bc11a086628e8cc0cc2c2dc200b884ac05c4b48fb71d6036b6999ff1d" "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" "checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" -"checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae" -"checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" -"checksum git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "046ae03385257040b2a35e56d9669d950dd911ba2bf48202fbef73ee6aab27b2" +"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" +"checksum generic-array 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "330920f60726e8a1ca0129a40f0f0df0b8ee773945bf34895d578f35f31dc660" +"checksum git2 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa01936ac96555c083c0e8553f672616274408d9d3fc5b8696603fbf63ff43ee" "checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa" -"checksum idna 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac85ec3f80c8e4e99d9325521337e14ec7555c458a14e377d189659a427f375" +"checksum hmac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdb5aa9647ba4711e9d6968dc1c810cd23989ed435443ca962e1bf6d8b8b83ff" +"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" +"checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be" "checksum itertools 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "772a0928a97246167d59a2a4729df5871f1327ab8b36fd24c4224b229cb47b99" "checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" -"checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502" -"checksum libgit2-sys 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a3aaa20337a0e79fb75180b6a1970c1f7cff9a413f570d6b999b38a5d5d54e81" -"checksum libssh2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "91e135645c2e198a39552c8c7686bb5b83b1b99f64831c040a6c2798a1195934" -"checksum libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e5ee912a45d686d393d5ac87fac15ba0ba18daae14e8e7543c63ebf7fb7e970c" +"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" +"checksum libgit2-sys 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "df18a822100352d9863b302faf6f8f25c0e77f0e60feb40e5dbe1238b7f13b1d" +"checksum libssh2-sys 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0db4ec23611747ef772db1c4d650f8bd762f07b461727ec998f953c614024b75" +"checksum libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd64ef8ee652185674455c1d450b83cbc8ad895625d543b5324d923f82e4d8" "checksum license-exprs 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "20e170a9f8785c9bb07576397a605ac453332e833a5eb5686cd4dcbb39cc1a66" -"checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad" -"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" -"checksum md5 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "26116c517166d074960f4ec6be77cd126878cfeb6f9616642108bf85f2d76515" +"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b" +"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" +"checksum md5 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "11f2f3240857d306c26118e2e92a5eaf8990df379e3d96573ee6c92cdbf58a81" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" -"checksum num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "98b15ba84e910ea7a1973bccd3df7b31ae282bf9d8bd2897779950c9b8303d40" +"checksum nodrop 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "52cd74cd09beba596430cc6e3091b74007169a56246e1262f0ba451ea95117b2" +"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" "checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" "checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" -"checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99" +"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" "checksum oauth2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f4fcd990d45681b9eba5f4f3fa7d0371ec277f4e4380a94104d26aa4fae386fc" -"checksum openssl 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "241bcf67b1bb8d19da97360a925730bdf5b6176d434ab8ded55b4ca632346e3a" +"checksum odds 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "c3df9b730298cea3a1c3faa90b7e2f9df3a9c400d0936d6015e6165734eefcba" +"checksum openssl 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)" = "11ba043cb65fc9af71a431b8a36ffe8686cd4751cdf70a473ec1d01066ac7e41" "checksum openssl-probe 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d98df0270d404ccd3c050a41d579c52d1db15375168bb3471e04ec0f5f378daf" -"checksum openssl-sys 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e0fd64cb2fa018ed2e7b2c8d9649114fe5da957c9a67432957f01e5dcc82e9" +"checksum openssl-sys 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)" = "236c718c2e2c2b58a546d86ffea5194400bb15dbe01ca85325ffd357b03cf66c" +"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" "checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum postgres 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aadd34ecc7aa81eae593f8299bb57e066277cda3d63713b2352245060713466d" -"checksum postgres-protocol 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fff03cdda9f350fe629b47fa921bd7e0f107aeefe59619a4fc053a9057cf0c0a" -"checksum postgres-shared 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "857ef343933a7d81e365a334f505a07db16ab7be64d9d7cd82c78d2f486777e4" -"checksum pq-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6f386bd842d8571f4df788f49e764bab85d30b3320b2ca98a2a24cfa8f65b903" +"checksum postgres 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b51f9f4b74a0d3a475fe272f5acc72761d750fd67af90cd2241bce49639ca395" +"checksum postgres-protocol 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "685d511cb92a2b534de8e698ad0e72372032093809dd8bd138b171102a92fb5b" +"checksum postgres-shared 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab14a2b628b6c36696d194e4b7c36187b505e2f51091191aeacfed89d6942d71" +"checksum pq-sys 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4dfb5e575ef93a1b7b2a381d47ba7c5d4e4f73bff37cee932195de769aad9a54" "checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum r2d2 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1dd448c29d0ed83cfe187ffb8608fa07c47abdd7997f3f478f3a6223ad3f97fb" "checksum r2d2-diesel 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1bbf44e6b988bcd783c4233eb9fd562a4412431b5b56deab063b84c4c18ad6c5" "checksum r2d2_postgres 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "00aae18ea6279c73dea01c5816fcd7ee1d0369e957f9445aebcbcb2927dd2b5c" "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" -"checksum redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "29dbdfd4b9df8ab31dec47c6087b7b13cbf4a776f335e4de8efba8288dda075b" +"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" -"checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01" +"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" -"checksum regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9191b1f57603095f105d317e375d19b1c9c5c3185ea9633a99a6dcbed04457" +"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" "checksum route-recognizer 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3255338088df8146ba63d60a9b8e3556f1146ce2973bc05a75181a42ce2256" "checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" @@ -1219,29 +1350,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver-parser 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fff3c9c5a54636ab95acd8c1349926e04cb1eb8cd70b5adced8a1d1f703a67" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af" -"checksum serde 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "38a3db3a5757f68069aba764b793823ea9fb9717c42c016f8903f8add50f508a" -"checksum serde_derive 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e46ef71ee001a4279a4513e79a6ebbb59da3a4987bf77a6df2e5534cd6f21d82" -"checksum serde_derive_internals 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "021c338d22c7e30f957a6ab7e388cb6098499dda9fd4ba1661ee074ca7a180d1" -"checksum serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ad8bcf487be7d2e15d3d543f04312de991d631cfe1b43ea0ade69e6a8a5b16a1" +"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" +"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" +"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" "checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" +"checksum sha2 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "84920f9ac881e94e33ec89e1b3dcd36040523a308a92548e01217ce35d8cf6a8" "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" +"checksum socket2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12cdbddbaa27bf94cc194b8e37f5811db6fe83cea96cf99cf1f8e92b65a41371" +"checksum stringprep 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c5ff9d098c000a75bb827d6d0d7c45082dfa0372467d29237f9590a3f87867d0" "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 thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" -"checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" -"checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7" +"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" "checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" "checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" -"checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" -"checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" +"checksum typenum 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7242a7857c31d13620847d78af39ecac8d6c90aac23286e84aefe624c77c9c14" +"checksum unicode-bidi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "149319afc0ec718611d4a9208c0308e3b1b62dcfbd982e5e723f6ec35b909b92" +"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" +"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" -"checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" -"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" +"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 utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" +"checksum vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9e0a7d8bed3178a8fb112199d466eeca9ed09a14ba8ad67718179b4fd5487d0b" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/src/dependency.rs b/src/dependency.rs index 5a15b8b9d4f..196b731d1fd 100644 --- a/src/dependency.rs +++ b/src/dependency.rs @@ -48,7 +48,8 @@ pub struct EncodableDependency { pub downloads: i32, } -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Serialize, Deserialize, Debug)] +#[serde(rename_all = "lowercase")] #[repr(u32)] pub enum Kind { Normal = 0, diff --git a/src/krate.rs b/src/krate.rs index ff41b393f87..1a3f4379309 100644 --- a/src/krate.rs +++ b/src/krate.rs @@ -1034,6 +1034,7 @@ pub fn show(req: &mut Request) -> CargoResult { #[derive(Serialize)] struct R { + #[serde(rename = "crate")] krate: EncodableCrate, versions: Vec, keywords: Vec, @@ -1185,6 +1186,7 @@ pub fn new(req: &mut Request) -> CargoResult { #[derive(Serialize)] struct R<'a> { + #[serde(rename = "crate")] krate: EncodableCrate, warnings: Warnings<'a>, } diff --git a/src/tests/all.rs b/src/tests/all.rs index 308d13825df..054585fe958 100644 --- a/src/tests/all.rs +++ b/src/tests/all.rs @@ -19,7 +19,6 @@ extern crate time; extern crate url; extern crate s3; -use serde_json::Value; use std::borrow::Cow; use std::collections::HashMap; use std::env; @@ -167,33 +166,9 @@ where let mut data = Vec::new(); r.body.write_body(&mut data).unwrap(); let s = std::str::from_utf8(&data).unwrap(); - let j = match serde_json::from_str(s) { + match serde_json::from_str(s) { Ok(t) => t, Err(e) => panic!("failed to decode: {:?}\n{}", e, s), - }; - let j = fixup(j); - return match serde_json::from_value::(j) { - Ok(t) => t, - Err(e) => panic!("failed to decode: {:?}\n{}", e, s), - }; - - - fn fixup(json: Value) -> Value { - match json { - Value::Object(object) => { - Value::Object( - object - .into_iter() - .map(|(k, v)| { - let k = if k == "crate" { "krate".to_string() } else { k }; - (k, fixup(v)) - }) - .collect(), - ) - } - Value::Array(list) => Value::Array(list.into_iter().map(fixup).collect()), - j => j, - } } } diff --git a/src/tests/krate.rs b/src/tests/krate.rs index 7d48d60aacf..a5ff12a60b9 100644 --- a/src/tests/krate.rs +++ b/src/tests/krate.rs @@ -46,11 +46,13 @@ struct Warnings { } #[derive(Deserialize)] struct GoodCrate { + #[serde(rename = "crate")] krate: EncodableCrate, warnings: Warnings, } #[derive(Deserialize)] struct CrateResponse { + #[serde(rename = "crate")] krate: EncodableCrate, versions: Vec, keywords: Vec, diff --git a/src/token.rs b/src/token.rs index 8b47559af31..b47f979f0cd 100644 --- a/src/token.rs +++ b/src/token.rs @@ -23,8 +23,8 @@ pub struct ApiToken { } /// The serialization format for the `ApiToken` model without its token value. -pub struct EncodableApiToken { #[derive(Deserialize, Serialize)] +pub struct EncodableApiToken { pub id: i32, pub name: String, pub created_at: String, @@ -34,8 +34,8 @@ pub struct EncodableApiToken { /// The serialization format for the `ApiToken` model with its token value. /// This should only be used when initially creating a new token to minimize /// the chance of token leaks. -pub struct EncodableApiTokenWithToken { #[derive(Deserialize, Serialize)] +pub struct EncodableApiTokenWithToken { pub id: i32, pub name: String, pub token: String, diff --git a/src/upload.rs b/src/upload.rs index 475d15b56fe..b12ebb3bb68 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -27,24 +27,24 @@ pub struct NewCrate { pub badges: Option>>, } -#[derive(PartialEq, Eq, Hash, Debug)] +#[derive(PartialEq, Eq, Hash, Serialize, Debug)] pub struct CrateName(pub String); #[derive(Debug)] pub struct CrateVersion(pub semver::Version); #[derive(Debug)] pub struct CrateVersionReq(pub semver::VersionReq); -#[derive(Debug)] +#[derive(Serialize, Debug)] pub struct KeywordList(pub Vec); -#[derive(Debug)] +#[derive(Serialize, Debug)] pub struct Keyword(pub String); -#[derive(Debug)] +#[derive(Serialize, Debug)] pub struct CategoryList(pub Vec); -#[derive(Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct Category(pub String); -#[derive(Debug)] +#[derive(Serialize, Debug)] pub struct Feature(pub String); -#[derive(Deserialize, Serialize, Debug)] +#[derive(Serialize, Deserialize, Debug)] pub struct CrateDependency { pub optional: bool, pub default_features: bool, @@ -94,12 +94,6 @@ impl<'de> Deserialize<'de> for Keyword { } } -impl<'de> Deserialize<'de> for Category { - fn deserialize>(d: D) -> Result { - String::deserialize(d).map(Category) - } -} - impl<'de> Deserialize<'de> for Feature { fn deserialize>(d: D) -> Result { let s = String::deserialize(d)?; @@ -178,40 +172,6 @@ impl<'de> Deserialize<'de> for CategoryList { } } } - -impl<'de> Deserialize<'de> for DependencyKind { - fn deserialize>(d: D) -> Result { - let s = String::deserialize(d)?; - match &s[..] { - "dev" => Ok(DependencyKind::Dev), - "build" => Ok(DependencyKind::Build), - "normal" => Ok(DependencyKind::Normal), - _ => { - const KINDS: &'static [&'static str] = &["dev", "build", "normal"]; - Err(de::Error::unknown_variant(&s, KINDS)) - } - } - } -} - -macro_rules! serialize_string { - ($name:ty) => ( - impl Serialize for $name { - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - serializer.serialize_str(self.deref()) - } - } - ) -} - -serialize_string!(CrateName); -serialize_string!(Keyword); -serialize_string!(Category); -serialize_string!(Feature); - - impl Serialize for CrateVersion { fn serialize(&self, serializer: S) -> Result where @@ -230,39 +190,6 @@ impl Serialize for CrateVersionReq { } } -impl Serialize for KeywordList { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let KeywordList(ref inner) = *self; - inner.serialize(serializer) - } -} - -impl Serialize for CategoryList { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let CategoryList(ref inner) = *self; - inner.serialize(serializer) - } -} - -impl Serialize for DependencyKind { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - match *self { - DependencyKind::Normal => "normal".serialize(serializer), - DependencyKind::Build => "build".serialize(serializer), - DependencyKind::Dev => "dev".serialize(serializer), - } - } -} - impl Deref for CrateName { type Target = str; fn deref(&self) -> &str { diff --git a/src/util/mod.rs b/src/util/mod.rs index 5c3cdeb22df..8651994faf7 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -3,7 +3,7 @@ use std::error::Error; use std::io::{self, Cursor}; use std::sync::Arc; -use serde_json::{self, Value}; +use serde_json; use serde::Serialize; use url; @@ -37,36 +37,17 @@ pub trait RequestUtils { } pub fn json_response(t: &T) -> Response { - let s = serde_json::to_string(t).unwrap(); - let json = fixup(s.parse().unwrap()).to_string(); + let json = serde_json::to_string(t).unwrap(); let mut headers = HashMap::new(); headers.insert( "Content-Type".to_string(), vec!["application/json; charset=utf-8".to_string()], ); headers.insert("Content-Length".to_string(), vec![json.len().to_string()]); - return Response { + Response { status: (200, "OK"), headers: headers, body: Box::new(Cursor::new(json.into_bytes())), - }; - - fn fixup(json: Value) -> Value { - match json { - Value::Object(object) => { - Value::Object( - object - .into_iter() - .map(|(k, v)| { - let k = if k == "krate" { "crate".to_string() } else { k }; - (k, fixup(v)) - }) - .collect(), - ) - } - Value::Array(list) => Value::Array(list.into_iter().map(fixup).collect()), - j => j, - } } }