Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed ticks function from &mut self to &self. #1033

Merged
merged 2 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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