Closed virtualritz closed 1 year ago
Hey @virtualritz
I'm planing to do some API polishing and make sure to remove all _get
s and _set
s 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. 😁
From the official Rust naming guidelines:
All getters should have the
get_
prefix removed.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.