Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: use From trait for KeyUsagePurpose -> u16 #289

Closed
wants to merge 1 commit into from

Conversation

cpu
Copy link
Member

@cpu cpu commented Aug 26, 2024

Quick follow-up from #287 Using a From impl feels a bit more idiomatic in this case.

present.then_some(*key_usage)
})
.collect()
}
}

/// Encode a key usage as the value of a BIT STRING as defined by RFC 5280.
/// [`u16`] is sufficient to encode the largest possible key usage value (two bytes).
impl From<KeyUsagePurpose> for u16 {
Copy link
Member

Choose a reason for hiding this comment

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

I dissuaded the OP from this because I thought we'd prefer to keep this interface private.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah ok! I don't feel strongly in that case. Apologies for the noise.

@cpu cpu closed this Aug 26, 2024
@cpu cpu deleted the cpu-287-follow-up branch August 26, 2024 15:11
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