Update to v0.13.0
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "elefren"
|
name = "elefren"
|
||||||
version = "0.12.0"
|
version = "0.13.0"
|
||||||
|
|
||||||
description = "A wrapper around the Mastodon API."
|
description = "A wrapper around the Mastodon API."
|
||||||
authors = ["Aaron Power <theaaronepower@gmail.com>", "Paul Woolcock <paul@woolcock.us>"]
|
authors = ["Aaron Power <theaaronepower@gmail.com>", "Paul Woolcock <paul@woolcock.us>"]
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ To add `elefren` to your project, add the following to the
|
|||||||
`[dependencies]` section of your `Cargo.toml`
|
`[dependencies]` section of your `Cargo.toml`
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
elefren = "0.12"
|
elefren = "0.13"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
///
|
///
|
||||||
/// ```toml,ignore
|
/// ```toml,ignore
|
||||||
/// [dependencies.elefren]
|
/// [dependencies.elefren]
|
||||||
/// version = "0.12"
|
/// version = "0.13"
|
||||||
/// features = ["toml"]
|
/// features = ["toml"]
|
||||||
/// ```
|
/// ```
|
||||||
pub mod toml;
|
pub mod toml;
|
||||||
|
|||||||
+6
-7
@@ -1,15 +1,15 @@
|
|||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use try_from::TryInto;
|
|
||||||
use reqwest::{Client, RequestBuilder, Response};
|
use reqwest::{Client, RequestBuilder, Response};
|
||||||
|
use try_from::TryInto;
|
||||||
|
|
||||||
use apps::{App, AppBuilder, Scopes};
|
use apps::{App, AppBuilder, Scopes};
|
||||||
use http_send::{HttpSend, HttpSender};
|
use http_send::{HttpSend, HttpSender};
|
||||||
use Data;
|
use Data;
|
||||||
|
use Error;
|
||||||
use Mastodon;
|
use Mastodon;
|
||||||
use MastodonBuilder;
|
use MastodonBuilder;
|
||||||
use Result;
|
use Result;
|
||||||
use Error;
|
|
||||||
|
|
||||||
const DEFAULT_REDIRECT_URI: &'static str = "urn:ietf:wg:oauth:2.0:oob";
|
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
|
/// ```no_run
|
||||||
/// # extern crate elefren;
|
/// # extern crate elefren;
|
||||||
/// # fn main () -> elefren::Result<()> {
|
/// # fn main () -> elefren::Result<()> {
|
||||||
/// use elefren::prelude::*;
|
/// use elefren::{apps::App, prelude::*};
|
||||||
/// use elefren::apps::App;
|
|
||||||
///
|
///
|
||||||
/// let mut app = App::builder();
|
/// let mut app = App::builder();
|
||||||
/// app.client_name("elefren_test");
|
/// app.client_name("elefren_test");
|
||||||
///
|
///
|
||||||
/// let registration = Registration::new("https://mastodon.social")
|
/// let registration = Registration::new("https://mastodon.social").register(app)?;
|
||||||
/// .register(app)?;
|
|
||||||
/// let url = registration.authorize_url()?;
|
/// let url = registration.authorize_url()?;
|
||||||
/// // Here you now need to open the url in the browser
|
/// // Here you now need to open the url in the browser
|
||||||
/// // And handle a the redirect url coming back with the code.
|
/// // 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>>
|
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 app = app.try_into()?;
|
||||||
let oauth = self.send_app(&app)?;
|
let oauth = self.send_app(&app)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user