Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 committed Oct 18, 2024
1 parent 71f5e2e commit 5e420f5
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 45 deletions.
22 changes: 0 additions & 22 deletions src/keyframes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ mod cards;
mod helpers;
mod toggler;

use crate::reexports::iced_core::{widget, Length};

pub use cards::Cards;
pub use helpers::cards;
pub use helpers::id;
pub use helpers::lazy;
pub use helpers::{chain, toggler};
pub use toggler::Toggler;

use crate::Timeline;

/// The macro used to cleanly and efficently build an animation chain.
/// Works for ann Id's that implement `into_chain` and `into_chain_with_children`
#[macro_export]
Expand All @@ -39,20 +34,3 @@ pub enum Repeat {
Never,
Forever,
}

pub trait IsChain {
fn repeat(&self) -> Repeat;
}

pub fn get_length(id: &widget::Id, timeline: &Timeline, index: usize, default: Length) -> Length {
timeline
.get(id, index)
.map_or(default, |m| Length::Fixed(m.value))
}

fn as_f32(length: Option<Length>) -> Option<f32> {
match length {
Some(Length::Fixed(i)) => Some(i),
_ => None,
}
}
1 change: 0 additions & 1 deletion src/keyframes/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ impl From<Chain> for crate::timeline::Chain {

#[must_use = "Keyframes are intended to be used in an animation chain."]
#[derive(Debug, Clone, Copy)]
///
pub struct Cards {
at: MovementType,
ease: Ease,
Expand Down
1 change: 0 additions & 1 deletion src/keyframes/toggler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ impl From<Chain> for crate::timeline::Chain {

#[must_use = "Keyframes are intended to be used in an animation chain."]
#[derive(Debug, Clone, Copy)]
///
pub struct Toggler {
at: MovementType,
ease: Ease,
Expand Down
7 changes: 1 addition & 6 deletions src/timeline.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
mod imports {
pub use cosmic::iced::time::{Duration, Instant};
pub use cosmic::iced_core::{
event::{self, Event},
widget, Hasher,
};
pub use cosmic::iced_core::widget;
pub use cosmic::iced_futures::subscription::Subscription;
}

Expand Down Expand Up @@ -574,8 +571,6 @@ impl Timeline {
/// Efficiently request redraws for animations.
/// Automatically checks if animations are in a state where redraws arn't necessary.
pub fn as_subscription(&self) -> Subscription<(cosmic::iced::window::Id, Instant)> {
use cosmic::iced;

if self.is_idle() {
Subscription::none()
} else {
Expand Down
8 changes: 0 additions & 8 deletions src/widget.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#![allow(clippy::too_many_arguments)]

use crate::{reexports::iced_core, utils::static_array_from_iter};

pub mod cards;
pub mod cosmic_toggler;

Expand All @@ -17,8 +14,3 @@ pub enum StyleType<T> {
/// The stlye is being animated. Blend between the two values.
Blend(T, T, f32),
}

use self::iced_core::{
gradient::{ColorStop, Linear},
Background, Color, Gradient, Radians, Vector,
};
8 changes: 1 addition & 7 deletions src/widget/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ use self::iced_core::{
};
use cosmic::{
iced_core::{self, Border, Shadow},
widget::{
button,
card::style::{Catalog, Style},
column, icon,
icon::Handle,
row, text,
},
widget::{button, card::style::Style, column, icon, icon::Handle, row, text},
};
use float_cmp::approx_eq;

Expand Down

0 comments on commit 5e420f5

Please sign in to comment.