Skip to content

Conversation

epage
Copy link
Contributor

@epage epage commented Sep 4, 2025

In using annotate-snippets, I was getting annoyed with the redundancy of Group::with_title(... primary_title()) and figured we could allow people to bypass that. With rustfmt, I also feel like the code more closely virtually matches the output.

We could also put fn element on a Level as a shortcut for Group::with_level but I figured that was an uncommon enough of a case to not provide a shortcut for so we don't accidentally steer users in the wrong direction.

The main downside is that this shortcut only works if there are elements. I have mixed feelings about what approach to take for title-only groups.

@Muscraft Muscraft merged commit 34475c7 into rust-lang:master Sep 4, 2025
15 checks passed
@epage epage deleted the shortcut branch September 4, 2025 20:34
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.

2 participants