Use where for Client constructors

This commit is contained in:
Curtis McEnroe 2015-11-28 19:18:20 -05:00
parent 2ac97c61ab
commit f718529298
1 changed files with 4 additions and 4 deletions

View File

@ -76,12 +76,12 @@ macro_rules! site_constructors {
) => { ) => {
$( $(
#[$attr] #[$attr]
pub fn $ident<S: Into<String>>( pub fn $ident<S>(
http_client: hyper::Client, http_client: hyper::Client,
client_id: S, client_id: S,
client_secret: S, client_secret: S,
redirect_uri: Option<S> redirect_uri: Option<S>
) -> Self { ) -> Self where S: Into<String> {
Client { Client {
http_client: http_client, http_client: http_client,
auth_uri: String::from($auth_uri), auth_uri: String::from($auth_uri),
@ -97,14 +97,14 @@ macro_rules! site_constructors {
impl Client { impl Client {
/// Creates an OAuth 2.0 client. /// Creates an OAuth 2.0 client.
pub fn new<S: Into<String>>( pub fn new<S>(
http_client: hyper::Client, http_client: hyper::Client,
auth_uri: S, auth_uri: S,
token_uri: S, token_uri: S,
client_id: S, client_id: S,
client_secret: S, client_secret: S,
redirect_uri: Option<S> redirect_uri: Option<S>
) -> Self { ) -> Self where S: Into<String> {
Client { Client {
http_client: http_client, http_client: http_client,
auth_uri: auth_uri.into(), auth_uri: auth_uri.into(),