You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it return the number of unused filled bits, that is an !u8 which according to the source code would equal to "8 - self.count".
Because to figure this out on your own one needs to read the source code and I'm not sure how future proof it is since it's not documented in the public std API.
My case - I'm creating a Zig UTF-8 string library [1] and when saving multiple Strings consecutively in binary format to disk they don't naturally pan out to byte boundaries. I could compute the bits between them but it's extra lines of (possible error-prone) code and more wasted CPU cycles.
In the API it's not documented, so one has to go to the source code to figure out how many unused bits are between 2 consecutive writes with or without flushes.
I'm not sure if this qualifies as an API bug or some type of request for enhancement.
If this report is inappropriate please just delete it.
Zig Version
0.14.0-dev.2384+cbc05e0b1
Steps to Reproduce and Observed Behavior
Currently the method returns !void
Expected Behavior
Make it return the number of unused filled bits, that is an !u8 which according to the source code would equal to "8 - self.count".
Because to figure this out on your own one needs to read the source code and I'm not sure how future proof it is since it's not documented in the public std API.
My case - I'm creating a Zig UTF-8 string library [1] and when saving multiple Strings consecutively in binary format to disk they don't naturally pan out to byte boundaries. I could compute the bits between them but it's extra lines of (possible error-prone) code and more wasted CPU cycles.
In the API it's not documented, so one has to go to the source code to figure out how many unused bits are between 2 consecutive writes with or without flushes.
I'm not sure if this qualifies as an API bug or some type of request for enhancement.
If this report is inappropriate please just delete it.
[1] https://github.com/f35f22fan/ZigString
The text was updated successfully, but these errors were encountered: