Skip to content

fix: Split out Message from Title #243

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 7 commits into from
Jul 3, 2025
Merged

Conversation

epage
Copy link
Contributor

@epage epage commented Jul 2, 2025

In #231, Level::header was split into Level::title and Level::pre_styled_title but

  • When to use each wasn't clear
  • "title" suggests a stronger role within the output than it is which can be confusing
  • Title contains an id even when it will go unused

This reworks things into

  • Level::title() -> Title: used for the first message within a group
    • uses a built-in styling
    • can have an id
  • Level::message() -> Message: used for additional text to be shown to the user
    • callers can provide their own styling
    • cannot have an id

Fixes #118

@epage
Copy link
Contributor Author

epage commented Jul 2, 2025

@Muscraft not too sure what I'm missing as to why the test failure is happening. I left Message out of some places or assumed some values but, looking at how its supposed to be used, these seem correct.

@epage epage force-pushed the message branch 2 times, most recently from d3751d8 to 4373542 Compare July 3, 2025 14:10
@Muscraft Muscraft merged commit 1d2ae61 into rust-lang:master Jul 3, 2025
14 of 15 checks passed
@epage epage deleted the message branch July 3, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename title to header
2 participants