diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-11-07 20:56:21 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-11-07 20:56:21 -0500 |
commit | 669c88a10a0930fd73e8fa5d587b3894aed1924b (patch) | |
tree | 594806c0c0870e54b0791ba9b2099cfeb36eee95 | |
parent | 35b5b8956f0bdf81da25380de7d3a6f243e6d1c0 (diff) | |
download | lastfm-query-669c88a10a0930fd73e8fa5d587b3894aed1924b.tar.gz lastfm-query-669c88a10a0930fd73e8fa5d587b3894aed1924b.zip |
simplify
-rw-r--r-- | src/cmd/sync.rs | 6 |
1 files 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"); |