hannesmann / keyframe

A simple library for animation in Rust
MIT License
129 stars 11 forks source link

Relax requirement of `value` types being `Copy` #9

Closed Type1J closed 2 years ago

Type1J commented 3 years ago

struct KeyFrame has the requirement of the value type to be Copy.

pub fn value(&self) -> T where T: Copy { self.value }

It seems that the library is attempting to allow Vec types as a value type, and Vec does not implement Copy, but it does implement Clone, so the where T: Copy should be changed to where T: Clone. There are a few places where an explicit .clone() call must be made to make this change work, but would allow Vec to be used.