I have been annoyed that I have to re-implement the
offset_of! macro in each of my projects. Because apparently nobody made a crate for it yet, I decided to remedy that.
The tiny crate that I made contains not only
offset_of! macro but also
align_of!. Why? Because of aesthetics: having
size_of! next to each other occur as macro is way prettier than the case where one of them is a macro and the other one is not. Controversial, I know!
We all know that naming things is hard. While with more sophisticated libraries one can be clever and creative with names, for crates with small utility functions it seems inappropriate.
So, the question to you, dear Rust community, is obvious: how should I name the crate? So far I have used
bytes_of because it mirrors the
*_of pattern used by implemented macros. Other candidates I have came up with include:
I should also note that I generally dislike names with underscores in them - they break my aesthetics, something I value far too much.
Any nice propositions? Or other thoughts? Maybe I should not pollute Cargo index with such tiny crate? Maybe having
size_of redefined as macros is a very bad thing and does more harm than good?