rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.76k stars 309 forks source link

Make `TakeWhileInclusive::new` private #912

Closed Philippe-Cholet closed 7 months ago

Philippe-Cholet commented 7 months ago

I don't know about you but I think it's hard to know what is accessible outside the crate (except manually reading docs.rs entirely). pub without documentation is private thanks to #![warn(missing_docs)] (denied in CI) but pub with a small documentation might be public without us knowing.

I therefore considered adding #![deny(unreachable_pub)] (description there). After doing so and (easily) fixing 60+ errors and ripgrep "pub ", I found out that TakeWhileInclusive has a public method new while we usually do not publish such method.

I'm actually not fully satisfied with unreachable_pub because some pub remain without being accessible outside the crate. (Maybe public-api is better suited for this).

Anyway, I here made TakeWhileInclusive::new private.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.38%. Comparing base (6814180) to head (81bac92). Report is 45 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #912 +/- ## ========================================== - Coverage 94.38% 94.38% -0.01% ========================================== Files 48 48 Lines 6665 6837 +172 ========================================== + Hits 6291 6453 +162 - Misses 374 384 +10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.