Skip to content

Commit

Permalink
Update old docs from Timer (bevyengine#6646)
Browse files Browse the repository at this point in the history
When I was upgrading to 0.9 noticed there were some changes to the timer, mainly the `TimerMode`.  When switching from the old `is_repeating()`  and `set_repeating()` to the new `mode()` and `set_mode()` noticed the docs still had the old description.
  • Loading branch information
edgarssilva authored and alradish committed Jan 22, 2023
1 parent 6a0eda1 commit 2299046
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/bevy_time/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Timer {
self.duration = duration;
}

/// Returns `true` if the timer is repeating.
/// Returns the mode of the timer.
///
/// # Examples
/// ```
Expand All @@ -168,7 +168,7 @@ impl Timer {
self.mode
}

/// Sets whether the timer is repeating or not.
/// Sets the mode of the timer.
///
/// # Examples
/// ```
Expand All @@ -177,6 +177,7 @@ impl Timer {
/// timer.set_mode(TimerMode::Once);
/// assert_eq!(timer.mode(), TimerMode::Once);
/// ```
#[doc(alias = "repeating")]
#[inline]
pub fn set_mode(&mut self, mode: TimerMode) {
if self.mode != TimerMode::Repeating && mode == TimerMode::Repeating && self.finished {
Expand Down

0 comments on commit 2299046

Please sign in to comment.