-
Notifications
You must be signed in to change notification settings - Fork 165
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
Rename internal types to match the public types #75
Comments
I think it would be neat to have the same name for the same functionality but for different modules: read::deflate::Encoder
read::zlib::Encoder
read::gz::Encoder So the module declaration would be: pub mod read {
pub mod deflate;
pub mod zlib;
pub mod gz;
} |
@opilar yeah that seems plausible, but other compression/decompression formats probably wouldn't want to mirror that (e.g. |
@alexcrichton so all encoders and decoders goes to one |
Oh no I think they'll be in |
(oops didn't mean to close) |
Hi! I'm interested in working on this (it'll be my first Rust OSS contribution). After reading through the code, I have a couple questions. Considering that existing structs can't be renamed to their exposed names without colliding (e.g., I poked around your other compression crates to try and find a convention but I found none. I was thinking perhaps either
...or others I'm not thinking of. What do you think? P.S. For what it's worth I see the convention in your other crates with respect to module structure, so I think I understand the motive for this Issue. However it almost seems worth going against the other crates' internals conventions because of how this crate contains three distinct (albeit related) compression formats, and because efforts to make this crate structurally similar to the others (i.e., by way of either of the options above) aren't so pretty. I'm interested to know what you all think. |
Thanks for picking this up @sw12! I think the header types are ok to keep living in a (private) For tests I'd just jettison them all from the library anyway. At this point they'd probably all be best as But yeah juggling the three similar-but-different-enough formats is a bit of a pain :( |
Cool. I've made a bit of progress--lots of deleting, replacing, deleting, etc.; for my future self's sake, what's the fastest way to do this kind of refactoring that you know of? What would be your procedure, roughly? In any case, my branch is here. |
@sw12 ah that's unfortunate, sorry about that! This is a problem that I think these errors are primarily related to
That way the top-level functions stay private to the crate (they're in a private module). Does that make sense? |
@sw12 how everything is going? I may would like to help you with your contribution. |
Looks like this has stalled. As far as I can tell we just need to do what @alexcrichton recommended above. @opilar feel free to do so if you like. |
Hi all. My sincere apologies for the unresponsiveness. Yes, Michael, you're
welcome to pick up where I left off if you're interested :)
…On Jun 2, 2017 8:21 PM, "Brian Anderson" ***@***.***> wrote:
Looks like this has stalled. As far as I can tell we just need to do what
@alexcrichton <https://github.com/alexcrichton> recommended above. @opilar
<https://github.com/opilar> feel free to do so if you like.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFXRM00tLfvfj9pB8yUb6lAIfSz1Ht2Yks5sANErgaJpZM4Mzd7P>
.
|
Looks like this is the only 1.0 blocker left. |
@opilar are you still making progress on this? |
@dtolnay sorry. No. |
Fixed in #120 |
The write/read/bufread modules all repeat the same type names:
Unfortunately the rustdoc for
flate2::read::GzEncoder
shows the private names:This is a rustdoc bug but even aside from that, this pattern is confusing to people browsing the code because what they see clicking through a [src] link does not match how they will be using the library. Let's try to make the real type names match the public names they are exported as.
Relevant API guideline: rust-lang/api-guidelines#5
Rustdoc bug: rust-lang/rust#41072
The text was updated successfully, but these errors were encountered: