fix cargo test
This commit is contained in:
parent
ff8b0aea71
commit
613c8e5d59
|
@ -6,7 +6,7 @@ pub mod response;
|
||||||
pub use self::error::ClientError;
|
pub use self::error::ClientError;
|
||||||
|
|
||||||
use reqwest;
|
use reqwest;
|
||||||
use reqwest::header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE};
|
use reqwest::header::{ACCEPT, CONTENT_TYPE};
|
||||||
use serde_json::{self, Value};
|
use serde_json::{self, Value};
|
||||||
use url::form_urlencoded::Serializer;
|
use url::form_urlencoded::Serializer;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
21
src/lib.rs
21
src/lib.rs
|
@ -103,27 +103,6 @@
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! ### Using bearer access tokens
|
|
||||||
//!
|
|
||||||
//! Bearer tokens can be converted to Hyper headers.
|
|
||||||
//!
|
|
||||||
//! ```no_run
|
|
||||||
//! # extern crate inth_oauth2;
|
|
||||||
//! # extern crate reqwest;
|
|
||||||
//! # use inth_oauth2::Client;
|
|
||||||
//! # use inth_oauth2::provider::google::Installed;
|
|
||||||
//! use reqwest::header::Authorization;
|
|
||||||
//!
|
|
||||||
//! # fn main() {
|
|
||||||
//! # let oauth_client = Client::new(Installed, String::new(), String::new(), None);
|
|
||||||
//! # let http = reqwest::Client::new();
|
|
||||||
//! # let token = oauth_client.request_token(&http, "").unwrap();
|
|
||||||
//! let request = http.get("https://example.com/resource")
|
|
||||||
//! .header(Into::<Authorization<_>>::into(&token))
|
|
||||||
//! .build();
|
|
||||||
//! # }
|
|
||||||
//! ```
|
|
||||||
//!
|
|
||||||
//! ### Persisting tokens
|
//! ### Persisting tokens
|
||||||
//!
|
//!
|
||||||
//! All token types implement `Serialize` and `Deserialize` from `serde`.
|
//! All token types implement `Serialize` and `Deserialize` from `serde`.
|
||||||
|
|
|
@ -8,7 +8,7 @@ use url::Url;
|
||||||
|
|
||||||
fn assert_get_uri_ok(uri: Url) {
|
fn assert_get_uri_ok(uri: Url) {
|
||||||
let response = reqwest::get(uri).unwrap();
|
let response = reqwest::get(uri).unwrap();
|
||||||
assert_eq!(reqwest::StatusCode::Ok, response.status());
|
assert_eq!(reqwest::StatusCode::OK, response.status());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue