rust-itertools / itertools

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

Give `take_while_inclusive` a more intuitive doc alias #972

Closed Ciel-MC closed 1 month ago

Ciel-MC commented 1 month ago

I could not for the life of me find this function lmao, it's called take until most places so I think an alias for searchability would be nice

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 94.24%. Comparing base (6814180) to head (65e49a1). Report is 112 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #972 +/- ## ========================================== - Coverage 94.38% 94.24% -0.15% ========================================== Files 48 49 +1 Lines 6665 6709 +44 ========================================== + Hits 6291 6323 +32 - Misses 374 386 +12 ```

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

Philippe-Cholet commented 1 month ago

@Ciel-MC Maybe #[doc(alias = "TakeUntil")] on TakeWhileInclusive?

jswrenn commented 1 month ago

Seems reasonable to me!

Ciel-MC commented 1 month ago

However, there is Iterator::take_while so it does not come from nowhere. 😀

I do understand that it didn't come from nowhere, but it is a bit like calling 2 "1+1", like yes it came from adding 1 to 1, but it has a pretty common name already.

@Ciel-MC Maybe #[doc(alias = "TakeUntil")] on TakeWhileInclusive?

I mean, I guess that is just as searchable? Though I'm not sure why you'd want it on the struct instead of the method(excuse my inexperience with api design)

Philippe-Cholet commented 1 month ago

It was a question. After searching doc aliases on rust-lang/rust, it sure does not alias structs much if at all, my bad.

Thanks