From d8cda22716b7bbeaa7a6717244611ce385e49d8a Mon Sep 17 00:00:00 2001 From: Archibald Neil MacDonald Date: Tue, 29 Sep 2020 23:56:14 +0100 Subject: [PATCH 1/2] Changed ticks function from `&mut self` to `&self`. --- changelog.md | 1 + src/sdl2/timer.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index ba3c62d2060..205d78564ef 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/src/sdl2/timer.rs b/src/sdl2/timer.rs index f6a226cf358..f321c5186f0 100644 --- a/src/sdl2/timer.rs +++ b/src/sdl2/timer.rs @@ -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() } } From 8d3521e85dfa045fcb58e06ca165c840be405d07 Mon Sep 17 00:00:00 2001 From: Archibald Neil MacDonald <1823745+aneilmac@users.noreply.github.com> Date: Wed, 30 Sep 2020 14:21:26 +0100 Subject: [PATCH 2/2] Update changelog.md Formatting error. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 205d78564ef..a55f6ff71db 100644 --- a/changelog.md +++ b/changelog.md @@ -4,7 +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`. + * Changed signature of TimerSubsystem::ticks to accept `&self`. ### v0.34.3