diff options
feat: Marquee, Lower dither opacity at top, DVD Logo should be separate function, Release Builds should work, advance_width should be f64 to save bytes, Vendor Micromod-RS, Add Timing Steps
Diffstat (limited to 'src/interpolation.rs')
-rw-r--r-- | src/interpolation.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/interpolation.rs b/src/interpolation.rs index ecb2c85..448ef43 100644 --- a/src/interpolation.rs +++ b/src/interpolation.rs @@ -90,7 +90,7 @@ impl<ValueType: Copy> AnimationTrack<ValueType> { } fn get_first_last(&self) -> Option<(KeyFrame<ValueType>, KeyFrame<ValueType>)> { let okf = self.get_sorted_keyframes(); - if okf.len() == 0 { + if okf.is_empty() { None } else { Some((*okf.first().unwrap(), *okf.last().unwrap())) @@ -175,14 +175,11 @@ impl< timing_function: TwoValueTimingFunction, ) -> Option<ValueType> { let frames = self.get_current_keyframes(sorted_keyframes, time); - match frames { - Some(frames) => Some(KeyFrame::raw_value_at( + frames.map(|frames| KeyFrame::raw_value_at( &frames.0, &frames.1, time, timing_function, - )), - None => None, - } + )) } } |