emoon / rust_minifb

Cross platfrom window and framebuffer crate for Rust
MIT License
1k stars 95 forks source link

Question: Why does KeyHandler::get_keys() return an Option? #259

Closed Zij-IT closed 2 years ago

Zij-IT commented 2 years ago

Hello there! I just started using minifb, and was looking at the source for KeyHandler::get_keys when I noticed that it returned a Option<Vec<Key>>, but I didn’t see a case in which it would ever return None.

I am curious what the reasoning behind that is. To me it seems like returning just a Vec<Keys> would suffice, as if no keys are pressed, the Vec is empy.

Thanks for your time!

emoon commented 2 years ago

Hey!

Good point. I guess there might have been some reason in the past but what you are saying makes sense. Can you do a PR that changes this?

Cheers!

Zij-IT commented 2 years ago

Gladly! I’ll have it to ya EOD!

beyarkay commented 2 years ago

Can this issue be closed?