Skip to content

Conversation

@npmccallum
Copy link
Contributor

There are a number of der types that could benefit from wrapping in a
newtype. For example, RelativeDistinguishedName could benefit from
an impl Display to convert it to a string representation. But because
it is just Vec<AttributeTypeAndValue> we can't really do this.

Having a systematic way to derive newtypes in these cases is thus
beneficial.

Signed-off-by: Nathaniel McCallum [email protected]

@npmccallum
Copy link
Contributor Author

@tarcieri Let me know if you like this approach or not. I have a bunch of types it could apply to. Particularly, x509 extensions.

@tarcieri
Copy link
Member

Hmmm, interesting. It kind of makes sense. Let me think about it a bit more.

@npmccallum
Copy link
Contributor Author

npmccallum commented Feb 26, 2022

FYI, I intend to combine this PR with the #451 and implement #417. So don't take too long thinking about it. ;)

@tarcieri
Copy link
Member

I guess this is fine. My only remaining concern is that "newtype" is pretty much exclusively used as a closed compound word, in which case the proper Rust capitalization is "Newtype"

There are a number of der types that could benefit from wrapping in a
newtype. For example, `RelativeDistinguishedName` could benefit from
an `impl Display` to convert it to a string representation. But because
it is just `Vec<AttributeTypeAndValue>` we can't really do this.

Having a systematic way to derive newtypes in these cases is thus
beneficial.

Signed-off-by: Nathaniel McCallum <[email protected]>
@npmccallum
Copy link
Contributor Author

@tarcieri I have renamed NewType => Newtype and new_type => newtype.

@tarcieri tarcieri merged commit 389372d into RustCrypto:master Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants