We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CtOption
struct C(A, B); fn create_c(a: &[u8], b: &[u8]) -> CtOption<C> { let a: CtOption<A> = A::from_bytes(a); let b: CtOption<B> = B::from_bytes(b); // ??? }
impl<T,U> CtOption<T> { pub fn merge<U>(self, other: CtOption<U>) -> CtOption<(T,U)> { CtOption { value: (self.value, other.value), is_some: self.is_some & other.is_some, } } }
let c = a.merge(b).map(|(a, b)| C(a,b));
May I prepare a PR? Or do you have any better idea?
The text was updated successfully, but these errors were encountered:
That API seems fine to me
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
My problem
Proposed solution
May I prepare a PR? Or do you have any better idea?
The text was updated successfully, but these errors were encountered: