diff --git a/Cargo.toml b/Cargo.toml index 9e0728b..8f7cb2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,11 +15,11 @@ chrono = ">= 0.2" log = ">= 0.3" mime = ">= 0.1" url = "= 0.5" -hyper = "= 0.8.0" +hyper = "^ 0.9.0" itertools = ">= 0.4" -serde = "0.6.0" -serde_json = "0.6.0" -serde_macros = { version = "0.6.0", optional = true } +serde = "0.7.5" +serde_json = "0.7.0" +serde_macros = { version = "0.7.5", optional = true } [features] default = ["with_syntex"] @@ -28,7 +28,7 @@ with_syntex = ["serde_codegen", "syntex"] [build-dependencies] syntex = { version = "=0.28.0", optional = true } -serde_codegen = { version = "=0.6.13", optional = true } +serde_codegen = { version = "0.7.5", optional = true } [dev-dependencies] getopts = "0.2" diff --git a/src/helper.rs b/src/helper.rs index 9c9a3da..2b4c2cd 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -1,6 +1,5 @@ use std::iter::IntoIterator; use std::borrow::BorrowMut; -use std::collections::HashMap; use std::hash::{SipHasher, Hash, Hasher}; use std::thread::sleep; use std::cmp::min; diff --git a/src/installed.rs b/src/installed.rs index 19f8701..9c50cbd 100644 --- a/src/installed.rs +++ b/src/installed.rs @@ -134,7 +134,6 @@ impl InstalledFlow where C: BorrowMut where T: AsRef + 'a, S: Iterator { - use std::error::Error; let authcode = try!(self.get_authorization_code(auth_delegate, &appsecret, scopes)); let tokens = try!(self.request_token(&appsecret, &authcode)); @@ -311,7 +310,7 @@ impl InstalledFlowHandler { // code, like this: http://localhost:8080/xyz/?code=4/731fJ3BheyCouCniPufAd280GHNV5Ju35yYcGs // We take that code and send it to the get_authorization_code() function that // waits for it. - for (param, val) in url.query_pairs().unwrap_or(Vec::new()) { + for (param, val) in url.query_pairs().into_owned() { if param == "code".to_string() { let _ = self.auth_code_snd.lock().unwrap().send(val); } diff --git a/src/lib.rs.in b/src/lib.rs.in index cdf1d22..4723c55 100644 --- a/src/lib.rs.in +++ b/src/lib.rs.in @@ -13,6 +13,7 @@ extern crate url; extern crate itertools; mod device; +mod storage; mod installed; mod helper; mod refresh; @@ -22,5 +23,6 @@ pub use device::{DeviceFlow, PollInformation, PollError}; pub use refresh::{RefreshFlow, RefreshResult}; pub use common::{Token, FlowType, ApplicationSecret, ConsoleApplicationSecret, Scheme, TokenType}; pub use installed::{InstalledFlow, InstalledFlowReturnMethod}; -pub use helper::{TokenStorage, NullStorage, MemoryStorage, Authenticator, AuthenticatorDelegate, +pub use storage::{TokenStorage, NullStorage, MemoryStorage, DiskTokenStorage}; +pub use helper::{Authenticator, AuthenticatorDelegate, Retry, DefaultAuthenticatorDelegate, GetToken}; diff --git a/src/storage.rs b/src/storage.rs index 2fc8dff..28f4a2c 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -7,7 +7,6 @@ extern crate serde_json; use std::collections::HashMap; -use std::hash::Hasher; use std::error::Error; use std::fmt; use std::fs; @@ -114,7 +113,6 @@ pub struct DiskTokenStorage { impl DiskTokenStorage { pub fn new(location: &String) -> Result { - use std::fs; let mut dts = DiskTokenStorage { location: location.clone(), tokens: HashMap::new(),