1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-01 18:51:04 +02:00

refactor: fix a few pedantic clippy warnings

This commit is contained in:
Jake Stanger 2023-04-29 22:08:38 +01:00
parent 7f46cb4976
commit 38da59cd41
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
4 changed files with 16 additions and 17 deletions

View file

@ -37,17 +37,16 @@ pub enum TransitionType {
}
impl TransitionType {
pub fn to_revealer_transition_type(&self, orientation: Orientation) -> RevealerTransitionType {
pub const fn to_revealer_transition_type(
&self,
orientation: Orientation,
) -> RevealerTransitionType {
match (self, orientation) {
(TransitionType::SlideStart, Orientation::Horizontal) => {
RevealerTransitionType::SlideLeft
}
(TransitionType::SlideStart, Orientation::Vertical) => RevealerTransitionType::SlideUp,
(TransitionType::SlideEnd, Orientation::Horizontal) => {
RevealerTransitionType::SlideRight
}
(TransitionType::SlideEnd, Orientation::Vertical) => RevealerTransitionType::SlideDown,
(TransitionType::Crossfade, _) => RevealerTransitionType::Crossfade,
(Self::SlideStart, Orientation::Horizontal) => RevealerTransitionType::SlideLeft,
(Self::SlideStart, Orientation::Vertical) => RevealerTransitionType::SlideUp,
(Self::SlideEnd, Orientation::Horizontal) => RevealerTransitionType::SlideRight,
(Self::SlideEnd, Orientation::Vertical) => RevealerTransitionType::SlideDown,
(Self::Crossfade, _) => RevealerTransitionType::Crossfade,
_ => RevealerTransitionType::None,
}
}
@ -152,7 +151,7 @@ impl CommonConfig {
revealer.connect_child_revealed_notify(move |revealer| {
if !revealer.reveals_child() {
container.hide()
container.hide();
}
});
},