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

Remove &mut self requirement in TimerSubsystem::delay() #1270

Merged
merged 3 commits into from
Nov 10, 2022
Merged

Remove &mut self requirement in TimerSubsystem::delay() #1270

merged 3 commits into from
Nov 10, 2022

Conversation

jordanhalase
Copy link
Contributor

It is safe to call TimerSubsystem::delay() with an immutable reference to &self as long as the subsystem is initialized. It otherwise breaks the ability to create timers. Closes #1268

@Cobrand
Copy link
Member

Cobrand commented Nov 8, 2022

LGTM! Please add this change to the changelog, then we'll be good to go.

@jordanhalase
Copy link
Contributor Author

Added to "Unreleased" section

@jordanhalase
Copy link
Contributor Author

I'm not entirely sure if changing a function's type signature from &mut self to &self is a breaking change but Rust definitely complains about unnecessary mut tags on variables.

@Cobrand
Copy link
Member

Cobrand commented Nov 10, 2022

Thanks!
It's not really a breaking change unless some people have a deny(warn) in their projects, but it doesn't matter that much either way.

@Cobrand Cobrand merged commit c2fba95 into Rust-SDL2:master Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDL_Delay() requires a &mut TimerSubsystem?
2 participants