Adds a MastodonClient trait

This is useful for user code, which can use the trait to add a layer of
indirection to their code, allowing them to swap out implementations for
testing
This commit is contained in:
Paul Woolcock
2018-08-21 16:29:57 -04:00
parent 6c37ecb1e1
commit 22b4b04738
8 changed files with 87 additions and 26 deletions
+1
View File
@@ -1,5 +1,6 @@
mod register;
use register::MastodonClient;
use std::error;
fn main() -> Result<(), Box<error::Error>> {
+2
View File
@@ -1,7 +1,9 @@
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()?;
+2
View File
@@ -1,6 +1,8 @@
extern crate mammut;
extern crate toml;
pub use self::mammut::MastodonClient;
use std::{
error::Error,
fs,
+1
View File
@@ -1,5 +1,6 @@
mod register;
use register::MastodonClient;
use std::error;
fn main() -> Result<(), Box<error::Error>> {
+1
View File
@@ -1,5 +1,6 @@
mod register;
use register::MastodonClient;
use std::error;
fn main() -> Result<(), Box<error::Error>> {