Clippy.
This commit is contained in:
parent
b062f0a19f
commit
94f6fdcbe7
@ -1,5 +1,6 @@
|
|||||||
#![cfg_attr(feature = "cargo-clippy",
|
#![cfg_attr(feature = "cargo-clippy",
|
||||||
allow(clone_on_ref_ptr, needless_pass_by_value, useless_format))]
|
allow(clone_on_ref_ptr, needless_pass_by_value, useless_format, blacklisted_name,
|
||||||
|
match_same_arms))]
|
||||||
#![allow(unknown_lints)]
|
#![allow(unknown_lints)]
|
||||||
#![deny(unused_extern_crates, unused)]
|
#![deny(unused_extern_crates, unused)]
|
||||||
|
|
||||||
|
|||||||
@ -289,12 +289,12 @@ impl DurationMachine {
|
|||||||
|
|
||||||
pub fn determine_state(self, seconds: Option<i32>) -> Self {
|
pub fn determine_state(self, seconds: Option<i32>) -> Self {
|
||||||
match (self, seconds) {
|
match (self, seconds) {
|
||||||
(DurationMachine::Hidden(val), None) => DurationMachine::Hidden(val.into()),
|
(d @ DurationMachine::Hidden(_), None) => d,
|
||||||
(DurationMachine::Shown(val), None) => DurationMachine::Hidden(val.into()),
|
(DurationMachine::Shown(val), None) => DurationMachine::Hidden(val.into()),
|
||||||
(DurationMachine::Hidden(val), Some(s)) => {
|
(DurationMachine::Hidden(val), Some(s)) => {
|
||||||
let minutes = chrono::Duration::seconds(s.into()).num_minutes();
|
let minutes = chrono::Duration::seconds(s.into()).num_minutes();
|
||||||
if minutes == 0 {
|
if minutes == 0 {
|
||||||
DurationMachine::Hidden(val.into())
|
DurationMachine::Hidden(val)
|
||||||
} else {
|
} else {
|
||||||
val.set_duration(minutes);
|
val.set_duration(minutes);
|
||||||
DurationMachine::Shown(val.into())
|
DurationMachine::Shown(val.into())
|
||||||
@ -306,7 +306,7 @@ impl DurationMachine {
|
|||||||
DurationMachine::Hidden(val.into())
|
DurationMachine::Hidden(val.into())
|
||||||
} else {
|
} else {
|
||||||
val.set_duration(minutes);
|
val.set_duration(minutes);
|
||||||
DurationMachine::Shown(val.into())
|
DurationMachine::Shown(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -808,6 +808,7 @@ pub enum MediaMachine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl MediaMachine {
|
impl MediaMachine {
|
||||||
|
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
play: gtk::Button,
|
play: gtk::Button,
|
||||||
download: gtk::Button,
|
download: gtk::Button,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user