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

Use boxed slices instead of vectors #181

Merged
merged 2 commits into from Jun 9, 2020
Merged

Use boxed slices instead of vectors #181

merged 2 commits into from Jun 9, 2020

Conversation

newpavlov
Copy link
Member

For consistency with the DynDigest trait.

@newpavlov newpavlov requested a review from tarcieri June 9, 2020 17:41
Copy link
Member

@tarcieri tarcieri left a comment

Choose a reason for hiding this comment

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

It might be good to mention why boxed slices are used in case someone else like me is curious.

@newpavlov newpavlov merged commit 294e992 into master Jun 9, 2020
@newpavlov newpavlov deleted the newpavlov-patch-1 branch June 9, 2020 17:46
fn finalize_vec(self) -> Vec<u8> {
let mut buf = Vec::with_capacity(self.output_size());
self.finalize_variable(|res| buf.extend_from_slice(res));
fn finalize_box(self) -> Box<[u8]> {
Copy link
Member

@tarcieri tarcieri Jun 9, 2020

Choose a reason for hiding this comment

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

Curious if finalize_boxed might make more sense here. I've seen both (e.g. box_clone seems common, but I've seen *_boxed as well)

@tarcieri tarcieri mentioned this pull request Jun 10, 2020
dns2utf8 pushed a commit to dns2utf8/traits that referenced this pull request Jan 24, 2023
…o#181)

Now that error handling has been improved in `password-hash` v0.2, these
are no longer needed as the errors will be properly handled in the
`hash_password_into` function.
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.

None yet

2 participants