From 669c88a10a0930fd73e8fa5d587b3894aed1924b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 7 Nov 2018 20:56:21 -0500 Subject: simplify --- src/cmd/sync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/sync.rs b/src/cmd/sync.rs index 3331db1..7dfb559 100644 --- a/src/cmd/sync.rs +++ b/src/cmd/sync.rs @@ -12,8 +12,8 @@ pub fn run(opts: &cli::Options) -> failure::Fallible<()> { opts.username.as_ref().unwrap() ); - let ts = db.most_recent_timestamp()?; - let to_fetch = lastfm.track_count(ts.map(|x| x + 1))?; + let from = db.most_recent_timestamp()?.map(|x| x + 1); + let to_fetch = lastfm.track_count(from)?; let bar = indicatif::ProgressBar::new(to_fetch); bar.set_style( @@ -22,7 +22,7 @@ pub fn run(opts: &cli::Options) -> failure::Fallible<()> { .template("Downloading {pos}/{len} tracks...\n{percent:>3}% [{wide_bar}] {eta:5}") ); - db.insert_tracks(bar.wrap_iter(lastfm.tracks(ts.map(|x| x + 1))))?; + db.insert_tracks(bar.wrap_iter(lastfm.tracks(from)))?; bar.finish_with_message("done"); -- cgit v1.2.3