Clippy suggestions

This commit is contained in:
Jordan Petridis 2018-01-29 19:09:53 +02:00
parent 817d5d9cf7
commit 2f062afb07
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
5 changed files with 11 additions and 7 deletions

View File

@ -89,7 +89,7 @@ fn bench_index_large_feed(c: &mut Criterion) {
.source_id(s.id())
.build()
.unwrap();
let _foo = core.run(feed.index()).unwrap();
core.run(feed.index()).unwrap();
})
});
truncate_db().unwrap();
@ -110,7 +110,7 @@ fn bench_index_small_feed(c: &mut Criterion) {
.source_id(s.id())
.build()
.unwrap();
let _foo = core.run(feed.index()).unwrap();
core.run(feed.index()).unwrap();
})
});
truncate_db().unwrap();

View File

@ -149,7 +149,7 @@ impl Source {
///
/// This only indexes the `Source` struct, not the Podcast Feed.
pub fn from_url(uri: &str) -> Result<Source> {
let url = Url::parse(&uri)?;
let url = Url::parse(uri)?;
NewSource::new(&url).to_source()
}

View File

@ -49,7 +49,7 @@ pub fn pipeline<S: IntoIterator<Item = Source>>(
sources: S,
ignore_etags: bool,
tokio_core: &mut Core,
pool: CpuPool,
pool: &CpuPool,
client: Client<HttpsConnector<HttpConnector>>,
) -> Result<()> {
let list: Vec<_> = sources
@ -69,7 +69,7 @@ pub fn pipeline<S: IntoIterator<Item = Source>>(
Ok(())
}
/// Creates a tokio-core, a cpu_pool, and a hyper::Client and runs the pipeline.
/// Creates a tokio `reactor::Core`, a `CpuPool`, and a `hyper::Client` and runs the pipeline.
pub fn run(sources: Vec<Source>, ignore_etags: bool) -> Result<()> {
if sources.is_empty() {
return Ok(());
@ -82,7 +82,7 @@ pub fn run(sources: Vec<Source>, ignore_etags: bool) -> Result<()> {
.connector(HttpsConnector::new(num_cpus::get(), &handle)?)
.build(&handle);
pipeline(sources, ignore_etags, &mut core, pool, client)
pipeline(sources, ignore_etags, &mut core, &pool, client)
}
fn determine_ep_state(ep: NewEpisodeMinimal, item: &rss::Item) -> Result<IndexState<NewEpisode>> {
@ -114,7 +114,8 @@ pub(crate) fn glue_async<'a>(
// Weird magic from #rust irc channel
// kudos to remexre
/// docs
/// FIXME: Docs
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
pub fn collect_futures<F>(
futures: Vec<F>,
) -> Box<Future<Item = Vec<std::result::Result<F::Item, F::Error>>, Error = Error>>

View File

@ -1,3 +1,5 @@
#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
use gdk_pixbuf::Pixbuf;
use send_cell::SendCell;

View File

@ -288,6 +288,7 @@ fn on_play_bttn_clicked(episode_id: i32) {
}
// Setup a callback that will update the progress bar.
#[cfg_attr(feature = "cargo-clippy", allow(if_same_then_else))]
fn update_progressbar_callback(
prog: Arc<Mutex<manager::Progress>>,
episode_rowid: i32,