Description
Got used to Rust's naming conventions and among them there's a less official one that recommends to name 'free' type casting functions as 'as_something()' and expensive ones as 'to_something()'
Surface::as_texture()
actually creates a new texture and copies surface data into it, so I believe it should be named to_texture()
Grep'ed the code and found several more cases like:
./src/sdl2/video.rs:98: fn to_gl_value(self) -> i32 { self as i32 }
It is problematic to change the APIs as there must be a lot of projects building on top of rust-sdl2, but maybe as_texture()
and others could be declared obsolete and removed when version bump allows that?
Rust supports deprecation marks
Semver 2.0 requires a minor version bump to deprecate and then a major bump to remove deprecated methods
I could do the changes myself if you agree that they are reasonable / worthy :)