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

Rename iter::Iterator::intersperse() to ::separate() #123110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukaslueg
Copy link
Contributor

@lukaslueg lukaslueg commented Mar 26, 2024

Following up in the suggestion voiced here, this

  • renames Iterator::intersperse() to Iterator::separate()
  • adds a doc-alias "intersperse" on separate()
  • renames Iterator::intersperse_with() to Iterator::separate_with()
  • renames the associated structs and modules, and updates all references

in order to move on wrt #79524. I have no opinion wrt #79524 (comment) being the correct solution to solve #79524

@rustbot
Copy link
Collaborator

rustbot commented Mar 26, 2024

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 26, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

HIR ty lowering was modified

cc @fmease

These commits modify compiler targets.
(See the Target Tier Policy.)

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@joboet
Copy link
Contributor

joboet commented Mar 26, 2024

r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 26, 2024
@rustbot rustbot assigned dtolnay and unassigned joboet Mar 26, 2024
@jhpratt jhpratt added the I-libs-api-nominated The issue / PR has been nominated for discussion during a libs-api team meeting. label Mar 26, 2024
@camelid
Copy link
Member

camelid commented Mar 27, 2024

Just wanted to note that there was some disagreement in the associated issue about whether we should merge separate and separate_with into one method separate that takes a closure. I'm personally in favor of two separate methods since this is the usual design in Rust and since a constant separator is much more common. But others disagree so that should be decided before merging this PR.

@bors
Copy link
Contributor

bors commented Apr 3, 2024

☔ The latest upstream changes (presumably #123396) made this pull request unmergeable. Please resolve the merge conflicts.

@jadebenn
Copy link

jadebenn commented Apr 10, 2024

Not to bikeshed too much, but I think separate is an awfully non-descriptive name for what this method does. My intuition at seeing that name would be that it somehow breaks up an existing collection, not that it adds a new element between each instance.

Something along the lines of interject, interleave, interweave, interlace, or perhaps even justseparator would seem more descriptive to me if the name just needs to be changed to avoid a conflict with itertools.

@Amanieu
Copy link
Member

Amanieu commented Apr 30, 2024

To give an update, we're currently trying to work around the naming conflict with a language-level feature: #89151 (comment)

@dtolnay dtolnay added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. I-libs-api-nominated The issue / PR has been nominated for discussion during a libs-api team meeting. labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants