Skip to content

BTreeSet: remove duplicated code by reusing from_sorted_iter #143111

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 29, 2025

Conversation

xu-cheng
Copy link
Contributor

The method BTreeSet::from_sorted_iter was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75,
but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic.
This commit fixes the problem.
@rustbot
Copy link
Collaborator

rustbot commented Jun 27, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 27, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 28, 2025

📌 Commit cd1713e has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 28, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 28, 2025
…k-Simulacrum

BTreeSet: remove duplicated code by reusing `from_sorted_iter`

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 28, 2025
…k-Simulacrum

BTreeSet: remove duplicated code by reusing `from_sorted_iter`

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 28, 2025
…k-Simulacrum

BTreeSet: remove duplicated code by reusing `from_sorted_iter`

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
bors added a commit that referenced this pull request Jun 28, 2025
Rollup of 10 pull requests

Successful merges:

 - #123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - #142708 (Do not include NUL-terminator in computed length)
 - #142963 (Skip unnecessary components in x64 try builds)
 - #142987 (rustdoc: show attributes on enum variants)
 - #143031 (Add windows-gnullvm hosts to the manifest)
 - #143082 (update internal `send_signal` comment)
 - #143110 (Use tidy to sort `sym::*` items)
 - #143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - #143114 (Minor Documentation Improvements)
 - #143137 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 28, 2025
…k-Simulacrum

BTreeSet: remove duplicated code by reusing `from_sorted_iter`

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
bors added a commit that referenced this pull request Jun 28, 2025
Rollup of 10 pull requests

Successful merges:

 - #123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - #142708 (Do not include NUL-terminator in computed length)
 - #142963 (Skip unnecessary components in x64 try builds)
 - #142974 (Update stage0 to 1.89.0-beta.1)
 - #142987 (rustdoc: show attributes on enum variants)
 - #143031 (Add windows-gnullvm hosts to the manifest)
 - #143082 (update internal `send_signal` comment)
 - #143110 (Use tidy to sort `sym::*` items)
 - #143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - #143114 (Minor Documentation Improvements)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jun 28, 2025
Rollup of 9 pull requests

Successful merges:

 - #123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - #142708 (Do not include NUL-terminator in computed length)
 - #142963 (Skip unnecessary components in x64 try builds)
 - #142987 (rustdoc: show attributes on enum variants)
 - #143031 (Add windows-gnullvm hosts to the manifest)
 - #143082 (update internal `send_signal` comment)
 - #143110 (Use tidy to sort `sym::*` items)
 - #143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - #143114 (Minor Documentation Improvements)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: dist-i586-gnu-i586-i686-musl
bors added a commit that referenced this pull request Jun 28, 2025
Rollup of 9 pull requests

Successful merges:

 - #123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - #142708 (Do not include NUL-terminator in computed length)
 - #142963 (Skip unnecessary components in x64 try builds)
 - #142987 (rustdoc: show attributes on enum variants)
 - #143031 (Add windows-gnullvm hosts to the manifest)
 - #143082 (update internal `send_signal` comment)
 - #143110 (Use tidy to sort `sym::*` items)
 - #143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - #143114 (Minor Documentation Improvements)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: dist-i586-gnu-i586-i686-musl
@bors bors merged commit dc08a0a into rust-lang:master Jun 29, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 29, 2025
rust-timer added a commit that referenced this pull request Jun 29, 2025
Rollup merge of #143111 - xu-cheng:btreeset_from_iter, r=Mark-Simulacrum

BTreeSet: remove duplicated code by reusing `from_sorted_iter`

The method `BTreeSet::from_sorted_iter` was introduced in 49ccb75, but it was not consistently used throughout the codebase. As a result, some code redundantly reimplemented its logic. This commit fixes the problem.
@xu-cheng xu-cheng deleted the btreeset_from_iter branch June 29, 2025 01:55
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 29, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#123476 (std::net: adding `unix_socket_exclbind` feature for solaris/illumos.)
 - rust-lang/rust#142708 (Do not include NUL-terminator in computed length)
 - rust-lang/rust#142963 (Skip unnecessary components in x64 try builds)
 - rust-lang/rust#142987 (rustdoc: show attributes on enum variants)
 - rust-lang/rust#143031 (Add windows-gnullvm hosts to the manifest)
 - rust-lang/rust#143082 (update internal `send_signal` comment)
 - rust-lang/rust#143110 (Use tidy to sort `sym::*` items)
 - rust-lang/rust#143111 (BTreeSet: remove duplicated code by reusing `from_sorted_iter`)
 - rust-lang/rust#143114 (Minor Documentation Improvements)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: dist-i586-gnu-i586-i686-musl
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants