jeremyletang / rust-sfml

SFML bindings for Rust
Other
631 stars 88 forks source link

Fix clippy errors #323

Closed dogunbound closed 7 months ago

dogunbound commented 7 months ago

Clippy was complaining that #[must_use] MUST be implemented for this function.

It was also complaining that a # Safety documentation has yet to be written.

The only part I believe that needs a code review is the message for the # Safety documentation. I've never used this function, so I am unsure what it does. I did my best reading off the context clues what the official SFML documentation, and usages I could find.

crumblingstatue commented 7 months ago

Thank you!

I ended up making Context::get_function safe, since it just returns a pointer. If the user wants to dereference that pointer, they will have to use unsafe anyway.

I put #[must_use] on it as well.