summaryrefslogtreecommitdiffstats
path: root/src/exporter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/exporter.rs')
-rw-r--r--src/exporter.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exporter.rs b/src/exporter.rs
index 89ad32c..29347f9 100644
--- a/src/exporter.rs
+++ b/src/exporter.rs
@@ -1,8 +1,6 @@
use db;
use lastfm;
-use error::Result;
-
pub struct Exporter<'d, 'l> {
db: &'d db::DB,
lastfm: &'l lastfm::LastFMClient,
@@ -19,12 +17,15 @@ impl<'d, 'l> Exporter<'d, 'l> {
}
}
- pub fn tracks_to_sync(&self) -> Result<u64> {
+ pub fn tracks_to_sync(&self) -> failure::Fallible<u64> {
let ts = self.db.most_recent_timestamp()?;
Ok(self.lastfm.track_count(ts.map(|x| x + 1))?)
}
- pub fn sync<F: FnMut(lastfm::Track)>(&self, track_cb: F) -> Result<()> {
+ pub fn sync<F: FnMut(lastfm::Track)>(
+ &self,
+ track_cb: F,
+ ) -> failure::Fallible<()> {
let ts = self.db.most_recent_timestamp()?;
self.db.insert_tracks(
self.lastfm.tracks(ts.map(|x| x + 1)),