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

rustdoc comments? #102

Open
cpu opened this issue May 27, 2024 · 2 comments
Open

rustdoc comments? #102

cpu opened this issue May 27, 2024 · 2 comments

Comments

@cpu
Copy link

cpu commented May 27, 2024

Hi there,

I noticed while reviewing some code using zlib-rs that most (all?) functions in https://docs.rs/zlib-rs/latest/zlib_rs/ are uncommented. (Examples: compress_bound, ReturnCode, uncompress_slice, etc).

Is this because the API is still considered unstable, or is the intent that users read the zlib manual? Would PRs adding rustdoc comments be accepted or is it too soon?

Thanks!

@folkertdev
Copy link
Collaborator

The status of the zlib-rs crate is weird because, for rust users the flate2 interface is much nicer and probably what they are already using, and for C (or other FFI) users the libz-rs-sys crate is the relevant api.

Because the libz-rs-sys api is determined by zlib itself and won't change, I think there we're absolutely ready to properly document behavior and safety assumptions. This will be based on the zlib manual but I think we can do better than that page (e.g. because we get to use markdown and can cross-link definitions).

For zlib-rs itself it is early, but on the other hand core pieces of functionality won't change drastically at this point.

So, I guess, go for it? with the knowledge that we may slightly tweak or move around certain definitions.

@cpu
Copy link
Author

cpu commented May 27, 2024

Makes sense 👍 Thanks for the quick reply.

For rust users the flate2 interface is much nicer and probably what they are already using

I think the context that had me looking at this might be a rare case where flate2 is too generic and we do want to be using zlib-rs directly (rustls/rustls#1966).

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