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

Improvement - get_key_pressed being mutable reference #160

Open
PerfectlyFineCode opened this issue Jun 16, 2023 · 0 comments
Open

Improvement - get_key_pressed being mutable reference #160

PerfectlyFineCode opened this issue Jun 16, 2023 · 0 comments

Comments

@PerfectlyFineCode
Copy link

PerfectlyFineCode commented Jun 16, 2023

Hi!

I stumbled upon this interesting detail that get_key_pressed is mutable, which means it breaks some behaviors.
get_gamepad_button_pressed isn't mutable, so why is get_key_pressed?

I made an extended function which calls exactly the same thing and it doesn't need to be mutable at all.
Code of said issue:
https://github.com/deltaphc/raylib-rs/blob/master/raylib/src/core/input.rs#L36
where it is a mutable reference to self, as no mutability is required. This can be removed.

@PerfectlyFineCode PerfectlyFineCode changed the title Improvement - get_key_pressed being mutable Improvement - get_key_pressed being mutable reference Jun 16, 2023
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

No branches or pull requests

1 participant