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

UX: Cloneable traits [age crate] #353

Open
mberry opened this issue Nov 16, 2022 · 0 comments
Open

UX: Cloneable traits [age crate] #353

mberry opened this issue Nov 16, 2022 · 0 comments

Comments

@mberry
Copy link

mberry commented Nov 16, 2022

For ergonomics it would nice to be able to clone the Identity and Recipient traits, had a few usecases where it becomes unwieldy without it.

Probably the easiest way to implement this is with https://github.com/dtolnay/dyn-clone,

There is also a convenience macro wrapper for that crate here: https://github.com/kardeiz/objekt-clonable, which ends up with minimal extra code and just adding supertraits, such as:

#[clonable]
pub trait Recipient: Clone {
 ...
}

Would also have to derive clone on some internal structs that use it too, Stanza, Header, BaseDecryptor, etc.

Could whip up a draft PR if this is something you be interested in. Thanks.

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

No branches or pull requests

1 participant