Lea-fish / Leafish

A minecraft-like multi version client implemented in Rust.
Apache License 2.0
824 stars 46 forks source link

Mark init function as unsafe #279

Open kitcatier opened 1 year ago

kitcatier commented 1 year ago

https://github.com/Lea-fish/Leafish/blob/f44cf08d818f755e9ca834ec6c55ee3912e67312/src/gl/mod.rs#L25-L29 Hello, it is not a good choice to mark the entire function body as unsafe, which will make the caller ignore the safety requirements that the function parameters must guarantee, the developer who calls the init function may not notice this safety requirement. Marking them unsafe also means that callers must make sure they know what they're doing.