cushy/gooey-macros/src/snapshots/gooey_macros__animation__test__enum_.snap
2023-11-14 20:03:30 +01:00

28 lines
817 B
Text

---
source: gooey-macros/src/animation.rs
expression: unparse(ok)
---
impl ::gooey::animation::LinearInterpolate for Enum {
/**# Panics
Panics if the the enum variants are overflown (this can only happen on percentages outside 0..1 range).*/
fn lerp(&self, __target: &Self, __percent: f32) -> Self {
fn variant_to_index(__v: &Enum) -> usize {
match __v {
Enum::A => 0usize,
Enum::B => 1usize,
}
}
let __self = variant_to_index(&self);
let __target = variant_to_index(&self);
match ::gooey::animation::LinearInterpolate::lerp(
&__self,
&__target,
__percent,
) {
0usize => Enum::A,
1usize => Enum::B,
_ => Enum::B,
}
}
}