Naming Conventions and Organization #34
-
Hey there! I'll start by saying I really like this library and it's super useful, but I feel like the module organization and type naming conventions feel a little weird and I was wondering what you thought about maybe tidying it up a little bit. Some, for instances:
Anyway, just some thoughts. 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, tidying up the names and stuff is planned to be done rather soon (it's been one of the main requirements for Some ideas:
To any readers out there, feel free to (politely) chime in regarding these ideas 🙂 |
Beta Was this translation helpful? Give feedback.
Yes, tidying up the names and stuff is planned to be done rather soon (it's been one of the main requirements for
0.x.0
releases).Some ideas:
If the macro can be made into a derive, then indeed it's very likely to become
#[derive(ReprC)]
(right now it hasn't sinceReprC
delegates to aCType
derive, and a derive macro cannot expand to another derive macro invocation).Should it not be possible, then the expected syntax would become
#[safer_ffi::repr(C)]
(so as to remove the "repr(C) redundancy" of the current annotations).I have recently had an idea of using a helper trait and a type alias to feature nicer paths: we could have
repr_c::Box<[T]>
Just Work™: