Code cleanup.
Converted rest of .clone() s on ref pointer to use the macro instead. Stopped ignoring clippy clone_on_ref_pointer warnings since there shouldn't be any, anymore.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clone_on_ref_ptr))]
|
||||
|
||||
use gtk;
|
||||
use gtk::prelude::*;
|
||||
|
||||
@@ -60,8 +58,6 @@ pub fn get_headerbar(db: &Arc<Mutex<SqliteConnection>>, stack: >k::Stack) -> g
|
||||
// and add a StackSwitcher when more views are added.
|
||||
home_button.connect_clicked(clone!(stack => move |_| stack.set_visible_child_name("pd_grid")));
|
||||
|
||||
let stack = stack.clone();
|
||||
let db = db.clone();
|
||||
// FIXME: There appears to be a memmory leak here.
|
||||
refresh_button.connect_clicked(clone!(stack, db => move |_| {
|
||||
utils::refresh_db(&db, &stack);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clone_on_ref_ptr))]
|
||||
|
||||
extern crate gdk;
|
||||
extern crate gdk_pixbuf;
|
||||
extern crate gio;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clone_on_ref_ptr))]
|
||||
|
||||
use glib;
|
||||
|
||||
use gtk;
|
||||
@@ -68,9 +66,9 @@ pub fn refresh_db(db: &Arc<Mutex<SqliteConnection>>, stack: >k::Stack) {
|
||||
pub fn refresh_feed(db: &Arc<Mutex<SqliteConnection>>, stack: >k::Stack, source: &mut Source) {
|
||||
let (sender, receiver) = channel();
|
||||
|
||||
GLOBAL.with(move |global| {
|
||||
*global.borrow_mut() = Some((db.clone(), stack.clone(), receiver));
|
||||
});
|
||||
GLOBAL.with(clone!(db, stack => move |global| {
|
||||
*global.borrow_mut() = Some((db, stack, receiver));
|
||||
}));
|
||||
|
||||
let mut source = source.clone();
|
||||
// TODO: add timeout option and error reporting.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clone_on_ref_ptr))]
|
||||
|
||||
use gtk;
|
||||
use gtk::prelude::*;
|
||||
|
||||
@@ -116,12 +114,9 @@ pub fn populate_flowbox_no_store(
|
||||
let pixbuf = get_pixbuf_from_path(img, title);
|
||||
let f = create_flowbox_child(title, pixbuf.clone());
|
||||
|
||||
let db = db.clone();
|
||||
let stack = stack.clone();
|
||||
let parent = parent.clone();
|
||||
f.connect_activate(move |_| {
|
||||
f.connect_activate(clone!(db, stack, parent => move |_| {
|
||||
on_flowbox_child_activate(&db, &stack, &parent, pixbuf.clone());
|
||||
});
|
||||
}));
|
||||
flowbox.add(&f);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(clone_on_ref_ptr))]
|
||||
|
||||
use open;
|
||||
use diesel::prelude::SqliteConnection;
|
||||
use hammond_data::dbqueries;
|
||||
|
||||
Reference in New Issue
Block a user