Skip to content

std: Refactor BufWriter::flush to use the ? operator#155741

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
xtqqczze:question-mark-bufwriter-flush
Apr 25, 2026
Merged

std: Refactor BufWriter::flush to use the ? operator#155741
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
xtqqczze:question-mark-bufwriter-flush

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

Functionally, this is equivalent and may be slightly more amenable to inlining.

@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 Apr 24, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

r? @jhpratt

rustbot has assigned @jhpratt.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, jhpratt, joboet

Copy link
Copy Markdown
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This preserves behavior and looks nicer -- .and_then(|()| ...) is a bit silly.

LGTM

View changes since this review

@WaffleLapkin
Copy link
Copy Markdown
Member

r? me
@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

📌 Commit 15e60eb has been approved by WaffleLapkin

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 24, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 25, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #155754 (make the `core::ffi::va_list` module private)
 - #155522 (cmse: test returning `MaybeUninit<T>`)
 - #155741 (std: Refactor BufWriter::flush to use the `?` operator)
@rust-bors rust-bors Bot merged commit 6f536cf into rust-lang:main Apr 25, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Apr 25, 2026
Rollup merge of #155741 - xtqqczze:question-mark-bufwriter-flush, r=WaffleLapkin

std: Refactor BufWriter::flush to use the `?` operator

Functionally, this is equivalent and may     be slightly more amenable to inlining.
@rustbot rustbot added this to the 1.97.0 milestone Apr 25, 2026
@xtqqczze
Copy link
Copy Markdown
Contributor Author

@WaffleLapkin there was an unrolled build for this PR, could it have affected perf?

@xtqqczze xtqqczze deleted the question-mark-bufwriter-flush branch April 25, 2026 11:18
@WaffleLapkin
Copy link
Copy Markdown
Member

I highly doubt this can affect perf in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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