diff options
| -rw-r--r-- | examples/rocket.rs | 3 | ||||
| -rw-r--r-- | src/bridge/reqwest.rs | 9 | ||||
| -rw-r--r-- | src/lib.rs | 9 |
3 files changed, 12 insertions, 9 deletions
diff --git a/examples/rocket.rs b/examples/rocket.rs index 13050ce..dd8e475 100644 --- a/examples/rocket.rs +++ b/examples/rocket.rs @@ -25,8 +25,7 @@ extern crate rocket; use rocket::response::Redirect; -use serenity_oauth::model::AccessTokenExchangeRequest; -use serenity_oauth::{DiscordOAuthReqwestRequester, Scope}; +use serenity_oauth::prelude::*; use std::env; use std::error::Error; diff --git a/src/bridge/reqwest.rs b/src/bridge/reqwest.rs index 971d594..fc313b6 100644 --- a/src/bridge/reqwest.rs +++ b/src/bridge/reqwest.rs @@ -18,17 +18,14 @@ use serde_urlencoded; /// the instance of hyper's Client will have those methods available: /// /// ```rust,no_run -/// extern crate hyper; -/// extern crate serenity_oauth; -/// /// # fn main() { -/// use hyper::Client; +/// use reqwest::blocking::Client; /// /// let client = Client::new(); /// /// // At this point, the methods defined by the trait are not in scope. By /// // using the trait, they will be. -/// use serenity_oauth::DiscordOAuthHyperRequester; +/// use serenity_oauth::DiscordOAuthReqwestRequester; /// /// // The methods defined by `DiscordOAuthHyperRequester` are now in scope and /// // implemented on the instance of hyper's `Client`. @@ -112,7 +109,7 @@ impl DiscordOAuthReqwestRequester for ReqwestClient { fn exchange_code(&self, request: &AccessTokenExchangeRequest) -> Result<AccessTokenResponse> { let body = serde_urlencoded::to_string(request)?; - let response = sel + let response = self .post(BASE_TOKEN_URI) .header(CONTENT_TYPE, "application/x-www-form-urlencoded") .body(body) @@ -1,4 +1,3 @@ -#![warn(missing_docs)] //! # serenity-oauth //! //! `serenity-oauth` is a collection of HTTP library support bridges for @@ -39,3 +38,11 @@ pub use bridge::hyper::DiscordOAuthHyperRequester; pub use bridge::reqwest::DiscordOAuthReqwestRequester; pub use error::{Error, Result}; pub use scope::Scope; + +#[allow(missing_docs)] +pub mod prelude { + pub use crate::bridge::hyper::DiscordOAuthHyperRequester; + pub use crate::bridge::reqwest::DiscordOAuthReqwestRequester; + pub use crate::model::*; + pub use crate::scope::Scope; +} |