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

Add SliceUnpacker which consumes the bytes when unpacking #52

Closed
Thoralf-M opened this issue Jul 14, 2022 · 1 comment
Closed

Add SliceUnpacker which consumes the bytes when unpacking #52

Thoralf-M opened this issue Jul 14, 2022 · 1 comment
Assignees

Comments

@Thoralf-M
Copy link
Member

Description

            let unlock = Unlock::unpack_verified(&mut signature_bytes).map_err(|_| crate::Error::PackableError)?;
            // this should be done automatically if signature_bytes has SliceUnpacker type
            signature_bytes.drain(0..unlock.packed_len());

Motivation

Easier to use, better performance

Requirements

Unpacking from a SliceUnpacker should consume the bytes

Are you planning to do it yourself in a pull request?

No.

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

2 participants