Skip to content

Conversation

@NobodyXu
Copy link

Having a safe API for MaybeUninit<u8> would be necessary for async-compression to wrap and reduce the performance penalty of initializing the buffer for all tokio::io::* traits implementation.

Also update process_vec API to use the new API instead of passing a &mut [u8] which technically violates rust's semantics.

Related PR: trifectatechfoundation/bzip2-rs#147 rust-lang/flate2-rs#502

@NobodyXu
Copy link
Author

Removed unused std::slice import and apply cargo-fmt suggestion

@NobodyXu
Copy link
Author

CI is green now

@ChanTsune
Copy link

@NobodyXu
Thank you for your PR!

Overall, the content looks fine, but there’s one point that concerns me.
It seems that process_uninit has no direct way of knowing the length written.
While it’s possible to calculate it by calling total_out before and after invoking process_uninit, in that case I believe the documentation should explicitly state this.
Alternatively, the return value should include the length written.

@NobodyXu
Copy link
Author

Thanks, I've updated the doc for process_uninit.

I decided to keep API of process and process_uninit similar with minimum change so that users can transition to new API seemlessly

@ChanTsune
Copy link

Thank you for updating the documentation. I’ll merge it.

@ChanTsune ChanTsune merged commit 43e4709 into Portable-Network-Archive:main Sep 28, 2025
23 checks passed
@ChanTsune
Copy link

ChanTsune commented Sep 28, 2025

@NobodyXu
Thank you for your contribution!

I’d love to include your name in the THANKS file. Do you have a preferred name you'd like us to use?

@NobodyXu
Copy link
Author

NobodyXu commented Sep 28, 2025

I’d love to include your name in the THANKS file. Do you have a preferred name you'd like us to use?

My preferred name is Jiahao XU, thank you for reviewing my PR!

@NobodyXu NobodyXu deleted the patch-1 branch September 28, 2025 02:33
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.

2 participants