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
Your edit from u32 to u64 here is revealing, because we don't make the BigDigit type alias public, and it's different between targets! It currently follows the target pointer width, but that's not an API commitment either. So I think there's not much we could put in our public API that would take advantage of Cow::Borrowed slices.
Alternatively, I started playing with a custom enum approach, where it stores either a single inline digit or a Vec as usual. This seems to work pretty well!
Instead of a
Vec<u64>
using aCow<'static, [u64]>
would enable people to create a const BigUint by just passing in a &'static [u64].Due to the nature of bigints I tend to see people creating a bunch of constant values at runtime.
Sure, it's not really that expensive, but it would be nice.
The text was updated successfully, but these errors were encountered: