Replace type aliases with newtypes #76
Labels
area/types
Related to rasn’s types for ASN.1
help wanted
Extra attention is needed
kind/enhancement
New feature or request
Instead of directly reexporting types such as
BigInt as Integer
andBytes as OctetString
, I think it makes a lot more sense to newtype these and provide a more stable interface so that the implementations can be changed without affecting the public API. For instance, being able to switch from usingnum-bigint
toibig
for parsing variable-sized integers could provide a significant speed increase, avoiding unnecessary allocations for small integers. However, changing theInteger
alias toIBig
would be a breaking change. Reexporting types also makes the docs quite a bit more confusing in my opinion, as the documentation for the types ends up using a completely, totally different type name, for example when I go to view the docs forOctetString
, I'm met with the following docs:Which is a bit jarring when the type signature is named something completely different IMO
The text was updated successfully, but these errors were encountered: