summaryrefslogtreecommitdiffstats
path: root/src/registration.rs
diff options
context:
space:
mode:
authorAaron Power <theaaronepower@gmail.com>2017-11-09 13:05:30 +0000
committerAaron Power <theaaronepower@gmail.com>2017-11-09 13:05:30 +0000
commitb6d350f29e026bdb92a6ad3d3ef6e9fd449470e4 (patch)
treed4bfc7460947c0bd4fee2976b2971d4764faebcd /src/registration.rs
parenta0c69aac432521602898a39b4685673d3efa9fa9 (diff)
updated reqwest and fixed media route
reqwest updated to 0.8 removed Result for creating Mastodon client as result of reqwest update added Meta and ImageDetails struct for Attachment Changed Attachment.id to String Added test for media route. Changed paramaters for media from Vec<u8> of image data to String of file path. Added dotenv for testing
Diffstat (limited to 'src/registration.rs')
-rw-r--r--src/registration.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/registration.rs b/src/registration.rs
index d725640..0407e1a 100644
--- a/src/registration.rs
+++ b/src/registration.rs
@@ -27,15 +27,15 @@ struct AccessToken {
}
impl Registration {
- pub fn new<I: Into<String>>(base: I) -> Result<Self> {
- Ok(Registration {
+ pub fn new<I: Into<String>>(base: I) -> Self {
+ Registration {
base: base.into(),
- client: Client::new()?,
+ client: Client::new(),
client_id: None,
client_secret: None,
redirect: None,
scopes: Scope::Read,
- })
+ }
}
/// Register the application with the server from the `base` url.
@@ -56,7 +56,7 @@ impl Registration {
/// website: None,
/// };
///
- /// let mut registration = Registration::new("https://mastodon.social")?;
+ /// let mut registration = Registration::new("https://mastodon.social");
/// registration.register(app)?;
/// let url = registration.authorise()?;
/// // Here you now need to open the url in the browser