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

Macro hygiene: `chain!` and qualified paths #943

Closed Philippe-Cholet closed 6 months ago

Philippe-Cholet commented 6 months ago

942 lead me to check our macro hygiene.

  1. If someone has a module named core and uses itertools::chain! then there is a conflict! I improve our macro hygiene test by adding (empty) modules with all the names we might be tempted to use. Without changing core in chain!, the test failed!
  2. Qualified paths only? Is conflict with .map and .zip absolutely impossible? Seems more bulletproof to me that way. EDIT: Found https://github.com/rust-itertools/itertools/pull/525#discussion_r584338246 which seems to indicate I'm right to use qualified paths.

PS: This is my πŸ’―th merged PR. πŸŽ‰

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 94.35%. Comparing base (6814180) to head (4588c02). Report is 94 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #943 +/- ## ========================================== - Coverage 94.38% 94.35% -0.03% ========================================== Files 48 49 +1 Lines 6665 7002 +337 ========================================== + Hits 6291 6607 +316 - Misses 374 395 +21 ```

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