From f58ad6bd8cd0e44ee1d89a631978794bde6fd127 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sat, 21 Oct 2017 21:24:19 +0300 Subject: [PATCH] applied some clippy suggestions. --- hammond-gtk/src/utils.rs | 4 ++-- hammond-gtk/src/views/podcasts_view.rs | 10 +++++----- hammond-gtk/src/widgets/episode.rs | 2 +- hammond-gtk/src/widgets/podcast.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hammond-gtk/src/utils.rs b/hammond-gtk/src/utils.rs index 03f5368..bbf11af 100644 --- a/hammond-gtk/src/utils.rs +++ b/hammond-gtk/src/utils.rs @@ -29,7 +29,7 @@ pub fn refresh_db(db: &Arc>, stack: >k::Stack) { // TODO: emit a signal in order to update the podcast widget. let _ = handle.join(); - podcasts_view::update_podcasts_view(&db, &stack); + podcasts_view::update_podcasts_view(db, stack); } pub fn refresh_feed(db: &Arc>, stack: >k::Stack, source: &mut Source) { @@ -55,7 +55,7 @@ pub fn refresh_feed(db: &Arc>, stack: >k::Stack, sourc // TODO: emit a signal in order to update the podcast widget. let _ = handle.join(); - podcasts_view::update_podcasts_view(&db, &stack); + podcasts_view::update_podcasts_view(db, stack); } // https://github. diff --git a/hammond-gtk/src/views/podcasts_view.rs b/hammond-gtk/src/views/podcasts_view.rs index 18a0ff9..0ae4d8e 100644 --- a/hammond-gtk/src/views/podcasts_view.rs +++ b/hammond-gtk/src/views/podcasts_view.rs @@ -72,7 +72,7 @@ pub fn populate_podcasts_flowbox( } fn setup_podcast_widget(db: &Arc>, stack: >k::Stack) { - let pd_widget = podcast_widget(&db, None, None, None); + let pd_widget = podcast_widget(db, None, None, None); stack.add_named(&pd_widget, "pdw"); } @@ -87,14 +87,14 @@ fn setup_podcasts_grid(db: &Arc>, stack: >k::Stack) { // FIXME: flowbox childs activate with space/enter but not with clicks. let flowbox: gtk::FlowBox = builder.get_object("flowbox").unwrap(); // Populate the flowbox with the Podcasts. - populate_podcasts_flowbox(&db, &stack, &flowbox); + populate_podcasts_flowbox(db, stack, &flowbox); } pub fn setup_stack(db: &Arc>) -> gtk::Stack { let stack = gtk::Stack::new(); // let _st_clone = stack.clone(); - setup_podcast_widget(&db, &stack); - setup_podcasts_grid(&db, &stack); + setup_podcast_widget(db, &stack); + setup_podcasts_grid(db, &stack); // stack.connect("update_grid", true, move |_| { // update_podcasts_view(&db_clone, &st_clone); // None @@ -109,7 +109,7 @@ pub fn update_podcasts_view(db: &Arc>, stack: >k::Stac let flowbox: gtk::FlowBox = builder.get_object("flowbox").unwrap(); // Populate the flowbox with the Podcasts. - populate_podcasts_flowbox(&db, &stack, &flowbox); + populate_podcasts_flowbox(db, stack, &flowbox); let old = stack.get_child_by_name("pd_grid").unwrap(); stack.remove(&old); diff --git a/hammond-gtk/src/widgets/episode.rs b/hammond-gtk/src/widgets/episode.rs index 73486b7..753c4ae 100644 --- a/hammond-gtk/src/widgets/episode.rs +++ b/hammond-gtk/src/widgets/episode.rs @@ -109,7 +109,7 @@ pub fn episodes_listbox(connection: &Arc>, pd_title: &st let list = gtk::ListBox::new(); episodes.iter_mut().for_each(|ep| { - let w = epidose_widget(&connection, ep, pd_title); + let w = epidose_widget(connection, ep, pd_title); list.add(&w) }); diff --git a/hammond-gtk/src/widgets/podcast.rs b/hammond-gtk/src/widgets/podcast.rs index d285b02..43e0bbe 100644 --- a/hammond-gtk/src/widgets/podcast.rs +++ b/hammond-gtk/src/widgets/podcast.rs @@ -110,7 +110,7 @@ pub fn podcast_liststore(connection: &SqliteConnection) -> gtk::ListStore { pub fn pd_widget_from_diesel_model(db: &Arc>, pd: &Podcast) -> gtk::Box { let img = get_pixbuf_from_path(pd.image_uri(), pd.title()); - podcast_widget(&db, Some(pd.title()), Some(pd.description()), img) + podcast_widget(db, Some(pd.title()), Some(pd.description()), img) } pub fn get_pixbuf_from_path(img_path: Option<&str>, pd_title: &str) -> Option {