Open nskinkel opened 9 years ago
I'd actually prefer using both. Returning a [u8; SIZE]
gives more type information than Vec<u8>
. You're right that it is somewhat incongruous with the C++-API's style, but C++ doesn't have a common array-like type like [u8; SIZE]
. This API isn't the primary one that we're intending to reveal to users anyway.
All functions return a
Result<T, Err>
, but I wonder if we should standardize the type of bytes we're returning? Some functions return a[u8]
, and some return aVec<u8>
. I'm wondering if we should just make all functions that return bytes return aVec<u8>
, even if we technically do know the byte length that will be returned at compile-time.For reference, the C++ NaCL API always returns
std::string
as far as I know, so it might make sense to do something similar withVec<u8>
.