-
Notifications
You must be signed in to change notification settings - Fork 3
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
[PLATFORM-864]: Add Redactable trait to Veil, for manually redacting structured data #63
Conversation
9389e1e
to
7401cb2
Compare
Rerequest review so I know when you're done 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems mostly fine for me, Your call on if you'd like to have another person review this before merging
src/util.rs
Outdated
@@ -1,38 +1,26 @@ | |||
/// HACK! To reduce code duplication in the generated binary, this macro is used to generate a | |||
/// HACK! To reduce code duplication in the generated binary, this function is used to generate a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code duplication in the generated binary
I don't think this reduces code duplication in the binary, right? Since the struct is a generic this does reduce the amount of source code written, but I don't think it has any impact on the generated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I clarified the meaning of the comment. If we made the functions in the private
module generic, it would lead to code duplication, is what I meant
https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/PLATFORM-864
This PR introduces the
Redactable
trait, one method of manually redacting data.This allows users to explicitly call
.redact()
or.redact_into()
on a type to get redacted data back from it.The trait can be derived using the newly introduced derive macro, or manually implemented for a type by hand.