Skip to content

Make some matches slightly more ergonomic in librustdoc #141131

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

Merged
merged 1 commit into from
May 17, 2025

Conversation

yotamofek
Copy link
Contributor

Bunch of small cleanups I found while working on other stuff, mostly getting rid of superfluous *s and ref [mut]s in matches,
makes the code less sigil/keyword-heavy, and slightly improves readability IMHO.
Also flattens a few nested matches.

@rustbot
Copy link
Collaborator

rustbot commented May 17, 2025

r? @notriddle

rustbot has assigned @notriddle.
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels May 17, 2025
@yotamofek yotamofek changed the title Simplify some match ergonomics in librustdoc Make some matches slightly more ergonomic in librustdoc May 17, 2025
@yotamofek yotamofek force-pushed the pr/rustdoc/match-ergo branch from 39dea03 to a4765c9 Compare May 17, 2025 13:24
@fmease
Copy link
Member

fmease commented May 17, 2025

Box patterns (box_patterns) are on their way out but since they'll likely be replaced with the more general deref patterns (#87121) before their removal if everything goes well 🤞 and since it's easy to revert these 5 box pats you added, I think it's fine.

@fmease
Copy link
Member

fmease commented May 17, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 17, 2025

📌 Commit a4765c9 has been approved by fmease

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 May 17, 2025
@fmease fmease assigned fmease and unassigned notriddle May 17, 2025
@yotamofek
Copy link
Contributor Author

Box patterns (box_patterns) are on their way out but since they'll likely be replaced with the more general deref patterns (#87121) before their removal if everything goes well 🤞 and since it's easy to revert these 5 box pats you added, I think it's fine.

Didn't know box_patterns is on its way out, but makes sense, I'm very excited for deref patterns! Would be cool to start dog-fooding it once it's out of "incomplete feature" status 😁

bors added a commit to rust-lang-ci/rust that referenced this pull request May 17, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#135808 (Implement Display for ``rustc_target::callconv::Conv``)
 - rust-lang#137432 (Add as_ascii_unchecked() methods to char, u8, and str)
 - rust-lang#139103 (deduplicate abort implementations)
 - rust-lang#140917 (checktools.sh: fix bashism)
 - rust-lang#141035 (turn lld warning on old gccs into info log)
 - rust-lang#141118 (Enable rust-analyzer to go from query definition to the corresponding provider field)
 - rust-lang#141121 (Only select true errors in `impossible_predicates`)
 - rust-lang#141125 (check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning)
 - rust-lang#141131 (Make some `match`es slightly more ergonomic in `librustdoc`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 339a46c into rust-lang:master May 17, 2025
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 17, 2025
Rollup merge of rust-lang#141131 - yotamofek:pr/rustdoc/match-ergo, r=fmease

Make some `match`es slightly more ergonomic in `librustdoc`

Bunch of small cleanups I found while working on other stuff, mostly getting rid of superfluous `*`s and `ref [mut]`s in `match`es,
makes the code less sigil/keyword-heavy, and slightly improves readability IMHO.
Also flattens a few nested `match`es.
@rustbot rustbot added this to the 1.89.0 milestone May 17, 2025
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants