Add Serde to "Persisting tokens" documentation

This commit is contained in:
Curtis McEnroe 2016-01-25 23:14:11 -05:00
parent 3cf2af8609
commit 6808f6bada
1 changed files with 14 additions and 1 deletions

View File

@ -108,7 +108,8 @@
//! //!
//! ### Persisting tokens //! ### Persisting tokens
//! //!
//! All token types implement `Encodable` and `Decodable` from `rustc_serialize`. //! All token types implement `Encodable` / `Decodable` from `rustc_serialize` and `Serialize` /
//! `Deserialize` from `serde`.
//! //!
//! ```no_run //! ```no_run
//! # extern crate inth_oauth2; //! # extern crate inth_oauth2;
@ -122,6 +123,18 @@
//! let json = json::encode(&token).unwrap(); //! let json = json::encode(&token).unwrap();
//! # } //! # }
//! ``` //! ```
//!
//! ```no_run
//! # extern crate inth_oauth2;
//! extern crate serde_json;
//! # use inth_oauth2::Client;
//! # use inth_oauth2::provider::Google;
//! # fn main() {
//! # let client = Client::<Google>::new(Default::default(), "", "", None);
//! # let token = client.request_token("").unwrap();
//! let json = serde_json::to_string(&token).unwrap();
//! # }
//! ```
#![warn( #![warn(
missing_docs, missing_docs,