Skip to content

Commit

Permalink
chore(serde): update to serde 0.5.0
Browse files Browse the repository at this point in the history
Serde move all json code into a separate crate, which we are now pulling
in separately.
  • Loading branch information
Byron committed Aug 8, 2015
1 parent 267b2ef commit a169d96
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "yup-oauth2"
version = "0.5.0"
version = "0.5.1"
authors = ["Sebastian Thiel <[email protected]>"]
repository = "https://github.com/Byron/yup-oauth2"
description = "A partial oauth2 implementation, providing the 'device' authorization flow"
Expand All @@ -18,7 +18,8 @@ mime = "*"
url = "*"
hyper = ">= 0.5.0"
itertools = "*"
serde = "*"
serde = ">= 0.5.0"
serde_json = "*"
serde_macros = { version = "*", optional = true }

[features]
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<a name="0.5.1"></a>
## 0.5.1 (2015-08-08)

* compatibility with serde 0.5.x

<a name="v0.5.0"></a>
## v0.5.0 (2015-06-18)

Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub mod tests {

#[test]
fn console_secret() {
use serde::json;
use serde_json as json;
match json::from_str::<ConsoleApplicationSecret>(SECRET) {
Ok(s) => assert!(s.installed.is_some() && s.web.is_none()),
Err(err) => panic!(err),
Expand Down
2 changes: 1 addition & 1 deletion src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use hyper;
use hyper::header::ContentType;
use url::form_urlencoded;
use itertools::Itertools;
use serde::json;
use serde_json as json;
use chrono::{DateTime,UTC};
use std::borrow::BorrowMut;
use std::io::Read;
Expand Down
2 changes: 1 addition & 1 deletion src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ mod tests {

#[test]
fn flow() {
use serde::json;
use serde_json as json;

let secret = json::from_str::<ConsoleApplicationSecret>(SECRET).unwrap().installed.unwrap();
let res = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! extern crate serde;
//!
//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, PollInformation, ConsoleApplicationSecret, MemoryStorage, GetToken};
//! use serde::json;
//! use serde_json as json;
//! use std::default::Default;
//! # const SECRET: &'static str = "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"UqkDJd5RFwnHoiG5x5Rub8SI\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"14070749909-vgip2f1okm7bkvajhi9jugan6126io9v.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}";
//!
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate serde;
extern crate serde_json;

extern crate chrono;

Expand Down
2 changes: 1 addition & 1 deletion src/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use device::GOOGLE_TOKEN_URL;
use chrono::UTC;
use hyper;
use hyper::header::ContentType;
use serde::json;
use serde_json as json;
use url::form_urlencoded;
use super::Token;
use std::borrow::BorrowMut;
Expand Down

0 comments on commit a169d96

Please sign in to comment.