Skip to content

Fix redundant boolean comparison in Mutex::try_lock#155532

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
StepfenShawn:patch-1
Apr 21, 2026
Merged

Fix redundant boolean comparison in Mutex::try_lock#155532
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
StepfenShawn:patch-1

Conversation

@StepfenShawn
Copy link
Copy Markdown
Contributor

Simplify boolean return in Mutex::try_lock.
Replace expr == false with !expr for cleaner code.

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

rustbot commented Apr 20, 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

@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented Apr 21, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

📌 Commit e1059f6 has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Apr 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
Rollup of 5 pull requests

Successful merges:

 - #155532 (Fix redundant boolean comparison in `Mutex::try_lock`)
 - #155558 (Clarify that isqrt returns the principal (non-negative) square root)
 - #155559 (add safety doc (section header) to two unsafe methods in `NonZero`)
 - #155564 (Implement const Default for &CStr)
 - #155565 (constify `Vec` comparisons)
@rust-bors rust-bors Bot merged commit 387df6e into rust-lang:main Apr 21, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 21, 2026
rust-timer added a commit that referenced this pull request Apr 21, 2026
Rollup merge of #155532 - StepfenShawn:patch-1, r=jhpratt

Fix redundant boolean comparison in `Mutex::try_lock`

Simplify boolean return in `Mutex::try_lock`.
Replace `expr == false` with `!expr` for cleaner code.
@StepfenShawn StepfenShawn deleted the patch-1 branch April 21, 2026 12:30
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.

3 participants