refactor: Centralize some more styling#16124
Merged
weihanglo merged 2 commits intorust-lang:masterfrom Oct 16, 2025
Merged
Conversation
Collaborator
weihanglo
approved these changes
Oct 16, 2025
| pub const UPDATE_DOWNGRADED: Style = WARN; | ||
| pub const UPDATE_UNCHANGED: Style = anstyle::Style::new().bold(); | ||
|
|
||
| pub const DEP_NORMAL: Style = anstyle::Style::new().effects(anstyle::Effects::DIMMED); |
Member
There was a problem hiding this comment.
My primary goal with this is having a central place to document this for other applications
Do you mean we'll have doc comments for each, or code itself is self-documented?
Ask because I don't think the variable names here describe the intent clear if not looking into the implementation
But anyway, having styles in one place is great.
Contributor
Author
There was a problem hiding this comment.
Do you mean we'll have doc comments for each, or code itself is self-documented?
Not quite either. I more care about having this specified in a central location to copy/paste from. annotate-snippets makes that copy/pasting more complex but oh well.
epage
added a commit
to epage/cargo
that referenced
this pull request
Oct 21, 2025
This is similar to rust-lang#16124 in making it easier for others to see what styles cargo uses and copy them.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 21, 2025
### What does this PR try to resolve? This is similar to #16124 in making it easier for others to see what styles cargo uses and copy them. ### How to test and review this PR?
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Oct 22, 2025
Update cargo submodule 7 commits in 367fd9f213750cd40317803dd0a5a3ce3f0c676d..344c4567c634a25837e3c3476aac08af84cf9203 2025-10-15 15:01:32 +0000 to 2025-10-21 21:29:43 +0000 - refactor: Centralize CONTEXT style (rust-lang/cargo#16135) - chore(triagebot): `A-json-output` for machine_message.rs (rust-lang/cargo#16133) - refactor: JSON message with less allocations (rust-lang/cargo#16130) - More warning conversions (rust-lang/cargo#16126) - fix(check): Fix suggested command for bin package (rust-lang/cargo#16127) - fix(script): Remove name sanitiztion outside what is strictly required (rust-lang/cargo#16120) - refactor: Centralize some more styling (rust-lang/cargo#16124) r? ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
On its own, this does nothing. These styles aren't used anywhere else and so this doesn't increase re-use.
My primary goal with this is having a central place to document this for other applications to track that want to mirror our style. In particular, I'm hoping to take advantage of the
UPDATEcolors in rustup.This also makes it easier for us to audit all of the values for consistency.
How to test and review this PR?