From bb860c9777d971a72e685148c6c1b2cdc13b3e0b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 22 Dec 2018 03:32:32 -0500 Subject: cargo clippy --- src/lastfm/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lastfm/mod.rs') diff --git a/src/lastfm/mod.rs b/src/lastfm/mod.rs index ed6e81b..0704e5a 100644 --- a/src/lastfm/mod.rs +++ b/src/lastfm/mod.rs @@ -5,7 +5,7 @@ use std::io::{Read, Write}; mod api_types; -const API_ROOT: &'static str = "https://ws.audioscrobbler.com/2.0/"; +const API_ROOT: &str = "https://ws.audioscrobbler.com/2.0/"; pub struct LastFMClient { client: reqwest::Client, @@ -38,7 +38,7 @@ impl<'a> Tracks<'a> { } fn get_next_page(&mut self) -> failure::Fallible<()> { - if !self.page.is_some() { + if self.page.is_none() { self.page = Some(self.client.get_total_pages(self.from)?); } let page = self.page.unwrap(); @@ -90,7 +90,7 @@ impl<'a> Iterator for Tracks<'a> { type Item = Track; fn next(&mut self) -> Option { - if self.buf.len() == 0 { + if self.buf.is_empty() { let result = self.get_next_page(); if result.is_err() { return None; -- cgit v1.2.3-54-g00ecf