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

Macro hygiene: chain! and qualified paths #943

Merged
merged 2 commits into from
May 21, 2024

Conversation

Philippe-Cholet
Copy link
Member

@Philippe-Cholet Philippe-Cholet commented May 21, 2024

#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 Add a chain! macro. #525 (comment) which seems to indicate I'm right to use qualified paths.

PS: This is my 💯th merged PR. 🎉

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!
Is conflict with `.map` and `.zip` absolutely impossible?
@Philippe-Cholet Philippe-Cholet added this to the next milestone May 21, 2024
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Philippe-Cholet Philippe-Cholet added this pull request to the merge queue May 21, 2024
@Philippe-Cholet Philippe-Cholet removed this pull request from the merge queue due to a manual request May 21, 2024
@Philippe-Cholet Philippe-Cholet added this pull request to the merge queue May 21, 2024
Merged via the queue into rust-itertools:master with commit 2ca3c5a May 21, 2024
13 checks passed
@Philippe-Cholet Philippe-Cholet deleted the macro-hygiene branch May 21, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants