Skip to content

Commit 990d5c0

Browse files
committed
Make AnimationClip::duration return value instead of reference (#4617)
Tiny follow-up to #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.
1 parent 73c78c3 commit 990d5c0

File tree

1 file changed

+3
-2
lines changed
  • crates/bevy_animation/src

1 file changed

+3
-2
lines changed

crates/bevy_animation/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ impl AnimationClip {
7474
}
7575

7676
/// Duration of the clip, represented in seconds
77-
pub fn duration(&self) -> &f32 {
78-
&self.duration
77+
#[inline]
78+
pub fn duration(&self) -> f32 {
79+
self.duration
7980
}
8081

8182
/// Add a [`VariableCurve`] to an [`EntityPath`].

0 commit comments

Comments
 (0)