From 4e5a2f5c5181b231ec2fb8917f4ad1680e89d99a Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Mon, 27 Aug 2018 20:04:26 -0400 Subject: [PATCH] Update to v0.13.0 --- Cargo.toml | 2 +- README.md | 2 +- src/helpers/mod.rs | 2 +- src/registration.rs | 13 ++++++------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 84b2167..4bc028e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "elefren" -version = "0.12.0" +version = "0.13.0" description = "A wrapper around the Mastodon API." authors = ["Aaron Power ", "Paul Woolcock "] diff --git a/README.md b/README.md index e89d1dd..b01895c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ To add `elefren` to your project, add the following to the `[dependencies]` section of your `Cargo.toml` ```toml -elefren = "0.12" +elefren = "0.13" ``` ## Usage diff --git a/src/helpers/mod.rs b/src/helpers/mod.rs index ecefb36..de0cfbf 100644 --- a/src/helpers/mod.rs +++ b/src/helpers/mod.rs @@ -5,7 +5,7 @@ /// /// ```toml,ignore /// [dependencies.elefren] -/// version = "0.12" +/// version = "0.13" /// features = ["toml"] /// ``` pub mod toml; diff --git a/src/registration.rs b/src/registration.rs index f7787eb..68f0498 100644 --- a/src/registration.rs +++ b/src/registration.rs @@ -1,15 +1,15 @@ use std::borrow::Cow; -use try_from::TryInto; use reqwest::{Client, RequestBuilder, Response}; +use try_from::TryInto; use apps::{App, AppBuilder, Scopes}; use http_send::{HttpSend, HttpSender}; use Data; +use Error; use Mastodon; use MastodonBuilder; use Result; -use Error; const DEFAULT_REDIRECT_URI: &'static str = "urn:ietf:wg:oauth:2.0:oob"; @@ -96,14 +96,12 @@ impl<'a, H: HttpSend> Registration<'a, H> { /// ```no_run /// # extern crate elefren; /// # fn main () -> elefren::Result<()> { - /// use elefren::prelude::*; - /// use elefren::apps::App; + /// use elefren::{apps::App, prelude::*}; /// /// let mut app = App::builder(); /// app.client_name("elefren_test"); /// - /// let registration = Registration::new("https://mastodon.social") - /// .register(app)?; + /// let registration = Registration::new("https://mastodon.social").register(app)?; /// let url = registration.authorize_url()?; /// // Here you now need to open the url in the browser /// // And handle a the redirect url coming back with the code. @@ -115,7 +113,8 @@ impl<'a, H: HttpSend> Registration<'a, H> { /// # } /// ``` pub fn register>(&mut self, app: I) -> Result> - where Error: From<>::Err> + where + Error: From<>::Err>, { let app = app.try_into()?; let oauth = self.send_app(&app)?;