rustfmt pass

This commit is contained in:
Paul Woolcock
2018-08-23 10:35:26 -04:00
parent d617d74fa4
commit 8636e690c3
18 changed files with 337 additions and 249 deletions
-1
View File
@@ -3,7 +3,6 @@ mod register;
use register::MastodonClient;
use std::error;
fn main() -> Result<(), Box<error::Error>> {
let mastodon = register::get_mastodon_data()?;
let you = mastodon.verify_credentials()?;
+5 -14
View File
@@ -3,19 +3,12 @@ extern crate toml;
pub use self::elefren::{Data, MastodonClient};
use std::{
error::Error,
fs,
io,
};
use std::{error::Error, fs, io};
use self::elefren::{
apps::{
App,
Scopes
},
apps::{App, Scopes},
Mastodon,
Registration
Registration,
};
#[allow(dead_code)]
@@ -24,7 +17,6 @@ fn main() -> Result<(), Box<Error>> {
Ok(())
}
#[allow(dead_code)]
pub fn get_mastodon_data() -> Result<Mastodon, Box<Error>> {
if let Ok(config) = fs::read_to_string("mastodon-data.toml") {
@@ -38,8 +30,8 @@ pub fn get_mastodon_data() -> Result<Mastodon, Box<Error>> {
pub fn register() -> Result<Mastodon, Box<Error>> {
let mut app = App::builder();
app.client_name("elefren-examples")
.scopes(Scopes::All)
.website("https://github.com/pwoolcoc/elefren");
.scopes(Scopes::All)
.website("https://github.com/pwoolcoc/elefren");
let website = read_line("Please enter your mastodon instance url:")?;
let registration = Registration::new(website.trim());
@@ -67,4 +59,3 @@ pub fn read_line(message: &str) -> Result<String, Box<Error>> {
Ok(input)
}