Get rid of clippy warnings
This commit is contained in:
committed by
Jordan Petridis
parent
e877da1825
commit
06a2c3ab12
@@ -18,7 +18,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
#![allow(new_without_default)]
|
||||
#![allow(clippy::new_without_default)]
|
||||
|
||||
use glib::subclass;
|
||||
use glib::subclass::prelude::*;
|
||||
|
||||
@@ -249,7 +249,7 @@ impl Header {
|
||||
.connect_activate(clone!(weak, sender => move |_| {
|
||||
weak.upgrade().map(|h| {
|
||||
if h.add.add.get_sensitive() {
|
||||
h.add.on_add_clicked(&sender);
|
||||
h.add.on_add_clicked(&sender).unwrap();
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#![cfg_attr(
|
||||
feature = "cargo-clippy",
|
||||
allow(clone_on_ref_ptr, blacklisted_name, match_same_arms,)
|
||||
#![allow(
|
||||
clippy::clone_on_ref_ptr,
|
||||
clippy::blacklisted_name,
|
||||
clippy::match_same_arms,
|
||||
unknown_lints
|
||||
)]
|
||||
#![allow(unknown_lints)]
|
||||
// Enable lint group collections
|
||||
#![warn(nonstandard_style, edition_2018, rust_2018_idioms, bad_style, unused)]
|
||||
// standalone lints
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
use gdk_pixbuf::{Object, Pixbuf};
|
||||
use glib::{self, object::WeakRef};
|
||||
@@ -115,7 +115,7 @@ pub(crate) fn lazy_load<T, C, F, W, U>(
|
||||
/// This is a more flexible version of `lazy_load` with less constrains.
|
||||
/// If you just want to lazy add `widgets` to a `container` check if
|
||||
/// `lazy_load` fits your needs first.
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(redundant_closure))]
|
||||
#[allow(clippy::redundant_closure)]
|
||||
pub(crate) fn lazy_load_full<T, F, U>(data: T, mut func: F, finish_callback: U)
|
||||
where
|
||||
T: IntoIterator + 'static,
|
||||
@@ -137,7 +137,7 @@ where
|
||||
|
||||
// Kudos to Julian Sparber
|
||||
// https://blogs.gnome.org/jsparber/2018/04/29/animate-a-scrolledwindow/
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(float_cmp))]
|
||||
#[allow(clippy::float_cmp)]
|
||||
pub(crate) fn smooth_scroll_to(view: >k::ScrolledWindow, target: >k::Adjustment) {
|
||||
if let Some(adj) = view.get_vadjustment() {
|
||||
if let Some(clock) = view.get_frame_clock() {
|
||||
@@ -423,7 +423,7 @@ pub(crate) fn on_import_clicked(window: >k::ApplicationWindow, sender: &Sender
|
||||
refresh(Some(sources), sender)
|
||||
} else {
|
||||
let text = i18n("Failed to parse the imported file");
|
||||
sender.send(Action::ErrorNotification(text)).expect("Action channel blew up somehow");;
|
||||
sender.send(Action::ErrorNotification(text)).expect("Action channel blew up somehow");
|
||||
}
|
||||
}))
|
||||
} else {
|
||||
|
||||
@@ -522,7 +522,7 @@ fn on_play_bttn_clicked(
|
||||
|
||||
// Setup a callback that will update the progress bar.
|
||||
#[inline]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(if_same_then_else))]
|
||||
#[allow(clippy::if_same_then_else)]
|
||||
fn update_progressbar_callback(
|
||||
widget: &Weak<EpisodeWidget>,
|
||||
prog: &Arc<Mutex<manager::Progress>>,
|
||||
@@ -535,7 +535,7 @@ fn update_progressbar_callback(
|
||||
timeout_add(100, callback);
|
||||
}
|
||||
|
||||
#[allow(if_same_then_else)]
|
||||
#[allow(clippy::if_same_then_else)]
|
||||
fn progress_bar_helper(
|
||||
widget: &Weak<EpisodeWidget>,
|
||||
prog: &Arc<Mutex<manager::Progress>>,
|
||||
|
||||
@@ -23,7 +23,6 @@ use gtk;
|
||||
use gtk::prelude::*;
|
||||
|
||||
use libhandy as hdy;
|
||||
use libhandy::prelude::HeaderBarExt;
|
||||
use libhandy::prelude::*;
|
||||
|
||||
use gio::{File, FileExt};
|
||||
@@ -244,14 +243,13 @@ impl PlayerRate {
|
||||
fn connect_signals(&self, widget: &Rc<PlayerWidget>) {
|
||||
let weak = Rc::downgrade(widget);
|
||||
|
||||
self.radio_normal
|
||||
.connect_toggled(clone!(weak => move |rate| {
|
||||
weak.upgrade().map(|w| w.on_rate_changed(1.00));
|
||||
}));
|
||||
self.radio125.connect_toggled(clone!(weak => move |rate| {
|
||||
self.radio_normal.connect_toggled(clone!(weak => move |_| {
|
||||
weak.upgrade().map(|w| w.on_rate_changed(1.00));
|
||||
}));
|
||||
self.radio125.connect_toggled(clone!(weak => move |_| {
|
||||
weak.upgrade().map(|w| w.on_rate_changed(1.25));
|
||||
}));
|
||||
self.radio150.connect_toggled(clone!(weak => move |rate| {
|
||||
self.radio150.connect_toggled(clone!(weak => move |_| {
|
||||
weak.upgrade().map(|w| w.on_rate_changed(1.50));
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user