Skip to content

refactor(core): refactor TokenStringExt#2888

Merged
elijah-potter merged 1 commit intoAutomattic:masterfrom
86xsk:refactor-token-str-ext
Apr 13, 2026
Merged

refactor(core): refactor TokenStringExt#2888
elijah-potter merged 1 commit intoAutomattic:masterfrom
86xsk:refactor-token-str-ext

Conversation

@86xsk
Copy link
Copy Markdown
Contributor

@86xsk 86xsk commented Mar 9, 2026

Description

Refactor TokenStringExt to provide default implementations for most of the trait's methods. This reduces the amount boilerplate needed to implement the trait.

With the changes, TokenStringExt has only 2 required methods: tokens and tokens_mut. The rest of the methods now have a default implementation that uses one of those 2 methods.

I don't think this is a breaking change, since (IIUC) the TokenStringExt trait is sealed, so it can't be implemented outside the crate. Not 100% sure though.

How Has This Been Tested?

  • cargo test

Checklist

  • I have performed a self-review of my own code
  • I have added tests to cover my changes

Refactor `TokenStringExt` to provide default implementations for most of
the trait's methods. This reduces the amount boilerplate needed to
implement the trait.
Copy link
Copy Markdown
Collaborator

@elijah-potter elijah-potter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This was sorely needed.

@elijah-potter elijah-potter added this pull request to the merge queue Apr 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 13, 2026
@elijah-potter
Copy link
Copy Markdown
Collaborator

It looks like GH Actions had an outage. I'm going to requeue this.

@elijah-potter elijah-potter added this pull request to the merge queue Apr 13, 2026
Merged via the queue into Automattic:master with commit 436d61d Apr 13, 2026
11 checks passed
@86xsk 86xsk deleted the refactor-token-str-ext branch April 13, 2026 19:26
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