Add $crate:: metavariable to the oid! macro #25

Merged
randombit merged 1 commits from jack/add-crate into master 2021-06-24 19:30:56 -07:00
randombit commented 2021-06-22 09:17:59 -07:00 (Migrated from github.com)

This allows using the oid macro without having to import BigUint

A little more context on this: I'm using RustCrypto/RSA which uses a fork of num-bigint and so within my code I already have a BigUint imported, but it is a different type than simple_asn1s BigUint. Currently to use the oid macro I must have BigUint imported from simple_asn1 and using that name.

But also just ergonomically, if someone is just creating an OID and not otherwise encoding integers there doesn't seem to be any need for them to know that there are bigints under the hood.

https://doc.rust-lang.org/reference/macros-by-example.html#hygiene

This allows using the oid macro without having to import BigUint A little more context on this: I'm using RustCrypto/RSA which uses a fork of num-bigint and so within my code I already have a `BigUint` imported, but it is a different type than `simple_asn1`s `BigUint`. Currently to use the `oid` macro I must have `BigUint` imported from `simple_asn1` and using that name. But also just ergonomically, if someone is just creating an OID and not otherwise encoding integers there doesn't seem to be any need for them to know that there are bigints under the hood. https://doc.rust-lang.org/reference/macros-by-example.html#hygiene
acw commented 2021-06-24 19:37:10 -07:00 (Migrated from github.com)

Thanks! This and your previous PR are now pushed to crates as v0.5.4.

Thanks! This and your previous PR are now pushed to crates as v0.5.4.
randombit commented 2021-06-25 05:06:14 -07:00 (Migrated from github.com)

Awesome thank you!

Awesome thank you!
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: acw/simple_asn1#25