Skip to content

Commit

Permalink
Merge pull request #1033 from aneilmac/make_ticks_const_ref
Browse files Browse the repository at this point in the history
Changed ticks function from `&mut self` to `&self`.
  • Loading branch information
Cobrand committed Sep 30, 2020
2 parents e883f12 + b526cec commit ed46532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -4,6 +4,7 @@ when upgrading from a version of rust-sdl2 to another.
### Unreleased

* Add patch to fix metal detection (https://bugzilla.libsdl.org/show_bug.cgi?id=4988)
* Changed signature of TimerSubsystem::ticks to accept `&self`.

### v0.34.3

Expand Down
2 changes: 1 addition & 1 deletion src/sdl2/timer.rs
Expand Up @@ -31,7 +31,7 @@ impl TimerSubsystem {
/// Gets the number of milliseconds elapsed since the timer subsystem was initialized.
///
/// It's recommended that you use another library for timekeeping, such as `time`.
pub fn ticks(&mut self) -> u32 {
pub fn ticks(&self) -> u32 {
// Google says this is probably not thread-safe (TODO: prove/disprove this).
unsafe { sys::SDL_GetTicks() }
}
Expand Down

0 comments on commit ed46532

Please sign in to comment.