applied some clippy suggestions.

This commit is contained in:
Jordan Petridis 2017-10-21 21:24:19 +03:00
parent 5f3d2d5bdd
commit f58ad6bd8c
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
4 changed files with 9 additions and 9 deletions

View File

@ -29,7 +29,7 @@ pub fn refresh_db(db: &Arc<Mutex<SqliteConnection>>, stack: &gtk::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<Mutex<SqliteConnection>>, stack: &gtk::Stack, source: &mut Source) {
@ -55,7 +55,7 @@ pub fn refresh_feed(db: &Arc<Mutex<SqliteConnection>>, stack: &gtk::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.

View File

@ -72,7 +72,7 @@ pub fn populate_podcasts_flowbox(
}
fn setup_podcast_widget(db: &Arc<Mutex<SqliteConnection>>, stack: &gtk::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<Mutex<SqliteConnection>>, stack: &gtk::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<Mutex<SqliteConnection>>) -> 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<Mutex<SqliteConnection>>, stack: &gtk::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);

View File

@ -109,7 +109,7 @@ pub fn episodes_listbox(connection: &Arc<Mutex<SqliteConnection>>, 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)
});

View File

@ -110,7 +110,7 @@ pub fn podcast_liststore(connection: &SqliteConnection) -> gtk::ListStore {
pub fn pd_widget_from_diesel_model(db: &Arc<Mutex<SqliteConnection>>, 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<Pixbuf> {