chore(serde): update to serde 0.5.0

Serde move all json code into a separate crate, which we are now pulling
in separately.
This commit is contained in:
Sebastian Thiel
2015-08-08 10:39:05 +02:00
parent 267b2ef770
commit a169d9610d
8 changed files with 14 additions and 7 deletions

View File

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

View File

@@ -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> <a name="v0.5.0"></a>
## v0.5.0 (2015-06-18) ## v0.5.0 (2015-06-18)

View File

@@ -190,7 +190,7 @@ pub mod tests {
#[test] #[test]
fn console_secret() { fn console_secret() {
use serde::json; use serde_json as json;
match json::from_str::<ConsoleApplicationSecret>(SECRET) { match json::from_str::<ConsoleApplicationSecret>(SECRET) {
Ok(s) => assert!(s.installed.is_some() && s.web.is_none()), Ok(s) => assert!(s.installed.is_some() && s.web.is_none()),
Err(err) => panic!(err), Err(err) => panic!(err),

View File

@@ -7,7 +7,7 @@ use hyper;
use hyper::header::ContentType; use hyper::header::ContentType;
use url::form_urlencoded; use url::form_urlencoded;
use itertools::Itertools; use itertools::Itertools;
use serde::json; use serde_json as json;
use chrono::{DateTime,UTC}; use chrono::{DateTime,UTC};
use std::borrow::BorrowMut; use std::borrow::BorrowMut;
use std::io::Read; use std::io::Read;

View File

@@ -481,7 +481,7 @@ mod tests {
#[test] #[test]
fn flow() { fn flow() {
use serde::json; use serde_json as json;
let secret = json::from_str::<ConsoleApplicationSecret>(SECRET).unwrap().installed.unwrap(); let secret = json::from_str::<ConsoleApplicationSecret>(SECRET).unwrap().installed.unwrap();
let res = Authenticator::new(&secret, DefaultAuthenticatorDelegate, let res = Authenticator::new(&secret, DefaultAuthenticatorDelegate,

View File

@@ -20,7 +20,7 @@
//! extern crate serde; //! extern crate serde;
//! //!
//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, PollInformation, ConsoleApplicationSecret, MemoryStorage, GetToken}; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, PollInformation, ConsoleApplicationSecret, MemoryStorage, GetToken};
//! use serde::json; //! use serde_json as json;
//! use std::default::Default; //! 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\"}}"; //! # 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\"}}";
//! //!

View File

@@ -1,4 +1,5 @@
extern crate serde; extern crate serde;
extern crate serde_json;
extern crate chrono; extern crate chrono;

View File

@@ -4,7 +4,7 @@ use device::GOOGLE_TOKEN_URL;
use chrono::UTC; use chrono::UTC;
use hyper; use hyper;
use hyper::header::ContentType; use hyper::header::ContentType;
use serde::json; use serde_json as json;
use url::form_urlencoded; use url::form_urlencoded;
use super::Token; use super::Token;
use std::borrow::BorrowMut; use std::borrow::BorrowMut;