Skip to content

Conversation

@vmx
Copy link
Member

@vmx vmx commented Feb 25, 2022

Changing from newtype struct to enum should hopefully make things
more robust.

Changing from newtype struct to enum should hopefully make things
more robust.
@vmx vmx requested a review from Stebalien March 1, 2022 10:27
@vmx
Copy link
Member Author

vmx commented Mar 1, 2022

The corresponding change for cbor: vmx/serde_ipld_dagcbor#5

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, this seems like it's strictly less likely to get misinterpreted. But the final decision is up to you.

visitor: V,
) -> Result<V::Value, Self::Error> {
let (variant, value) = match self {
if name == CID_SERDE_PRIVATE_IDENTIFIER && variants == [CID_SERDE_PRIVATE_IDENTIFIER] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible extension: allow the variants to be arbitrary IPLD kinds.

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.

3 participants