hapi-rs
hapi-rs copied to clipboard
Make naming canonical
From the official Rust naming guidelines:
Crate names should not use
-rsor-rustas a suffix or prefix. Every crate is Rust! It serves no purpose to remind users of this constantly.
All getters should have the get_ prefix removed.
With a few exceptions, the a
get_prefix is not used for getters in Rust code.
There may be more. These are just what I saw immediately when skimming the docs.
Edit: it looks like most of the crate already does that.
I just saw parameter::get_value() when skimming the docs so I wrongly assumed this was used everywhere.
Hey @virtualritz
I'm planing to do some API polishing and make sure to remove all _gets and _sets where it makes sense. Regarding the -rs naming, while it's true for pure Rust crates, there are numerous of crates that bind to other C/C++ APIs and community seems to stick to -sys for raw bindings and -rs for idiomatic Rust. But I don't mind to rename it at some point either.
Cheers.
Cool.
-sys is correct for RAW binding crates. But -rs for anything, including hand written, canonical Rust APIs over -sys crates is not.
My guess is that the authors of the other crates either didn't know about the API guidelines or ignored them intentionally.
I didn't know about this until my second year of Rust and had already written some wrappers by then. So I fell for this myself. 😁