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:
parent
73c78c3667
commit
990d5c0879
@ -74,8 +74,9 @@ impl AnimationClip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Duration of the clip, represented in seconds
|
/// Duration of the clip, represented in seconds
|
||||||
pub fn duration(&self) -> &f32 {
|
#[inline]
|
||||||
&self.duration
|
pub fn duration(&self) -> f32 {
|
||||||
|
self.duration
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add a [`VariableCurve`] to an [`EntityPath`].
|
/// Add a [`VariableCurve`] to an [`EntityPath`].
|
||||||
|
Loading…
Reference in New Issue
Block a user