Skip to content

Add Clone derive to Error enum#78

Open
smalis-msft wants to merge 1 commit into
RustCrypto:masterfrom
smalis-msft:patch-1
Open

Add Clone derive to Error enum#78
smalis-msft wants to merge 1 commit into
RustCrypto:masterfrom
smalis-msft:patch-1

Conversation

@smalis-msft
Copy link
Copy Markdown

No description provided.

Comment thread aes-kw/src/error.rs
use core::fmt;

/// Errors emitted from the wrap and unwrap operations.
#[derive(Debug, PartialEq, Eq)]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably also worth to derive Copy and Hash as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm hesitant to add Copy because it can become very restrictive if more variants are added in the future. As for Hash, are errors likely to be used as hashmap keys? I think this current set of traits is the right set of tradeoffs, and consistent with most of the other RustCrypto crates' error enums.

Copy link
Copy Markdown
Member

@newpavlov newpavlov May 15, 2026

Choose a reason for hiding this comment

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

Since this enum is not marked with #[non_exhaustive] addition of new variants would be a breaking change anyway. Derivation of Hash is just for completeness sake.

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