Make AnimationClip::duration return value instead of reference (#4617)

Tiny follow-up to https://github.com/bevyengine/bevy/pull/4615 as discussed on Discord here: https://discord.com/channels/691052431525675048/692572690833473578/968945307767414855

Since f32 is `Copy` and smaller than a reference on most systems (or at least not larger), there's no reason not to copy it, which should be more convenient to use.
This commit is contained in:
Olexorus 2022-04-27 23:44:06 +00:00
parent 73c78c3667
commit 990d5c0879

View File

@ -74,8 +74,9 @@ impl AnimationClip {
}
/// Duration of the clip, represented in seconds
pub fn duration(&self) -> &f32 {
&self.duration
#[inline]
pub fn duration(&self) -> f32 {
self.duration
}
/// Add a [`VariableCurve`] to an [`EntityPath`].