Skip to content

Commit

Permalink
fix(deps): Use small base64 crate instead of rustc-serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
dermesser committed Sep 28, 2016
1 parent 8d9c42c commit a4d60e7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ license = "MIT OR Apache-2.0"
build = "src/build.rs"

[dependencies]
base64 = "0.2"
chrono = ">= 0.2"
hyper = "^ 0.9.0"
itertools = ">= 0.4"
log = ">= 0.3"
openssl = "0.7"
rustc-serialize = "0.3"
serde = "0.8"
serde_json = "0.8"
serde_macros = { version = "0.8", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate serde;
extern crate serde_json;
extern crate rustc_serialize;

extern crate base64;
extern crate chrono;
extern crate openssl;
extern crate hyper;
Expand Down
6 changes: 2 additions & 4 deletions src/service_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use storage::{hash_scopes, MemoryStorage, TokenStorage};
use hyper::header;
use url::form_urlencoded;

use base64;
use chrono;
use hyper;
use openssl;
use rustc_serialize;
use serde_json;

const GRANT_TYPE: &'static str = "urn:ietf:params:oauth:grant-type:jwt-bearer";
Expand All @@ -36,9 +36,7 @@ const GOOGLE_RS256_HEAD: &'static str = "{\"alg\":\"RS256\",\"typ\":\"JWT\"}";

// Encodes s as Base64
fn encode_base64<T: AsRef<[u8]>>(s: T) -> String {
use rustc_serialize::base64::ToBase64;

s.as_ref().to_base64(rustc_serialize::base64::URL_SAFE)
base64::encode(s.as_ref())
}

// Calculates the SHA256 hash.
Expand Down

0 comments on commit a4d60e7

Please sign in to comment.