summaryrefslogtreecommitdiffstats
path: root/src/registration.rs
diff options
context:
space:
mode:
authorPaul Woolcock <paul@woolcock.us>2018-08-27 20:04:26 -0400
committerPaul Woolcock <paul@woolcock.us>2018-08-27 20:05:11 -0400
commit4e5a2f5c5181b231ec2fb8917f4ad1680e89d99a (patch)
treead69655245c5e6cfa41b2c303a663a1b19b3d86d /src/registration.rs
parent1b54c20060cd58f55d0236be5209f7b841a3f299 (diff)
Update to v0.13.0
Diffstat (limited to 'src/registration.rs')
-rw-r--r--src/registration.rs13
1 files changed, 6 insertions, 7 deletions
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<I: TryInto<App>>(&mut self, app: I) -> Result<Registered<H>>
- where Error: From<<I as TryInto<App>>::Err>
+ where
+ Error: From<<I as TryInto<App>>::Err>,
{
let app = app.try_into()?;
let oauth = self.send_app(&app)?;