Skip to content

Add Token::into_encoded - #125

Merged
asmello merged 1 commit into
mainfrom
feat/token-into-encoded
Jul 26, 2026
Merged

Add Token::into_encoded#125
asmello merged 1 commit into
mainfrom
feat/token-into-encoded

Conversation

@asmello

@asmello asmello commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Token::into_encoded(self) -> Cow<'a, str>, which consumes the Token and returns its encoded string representation.
  • Since the Token internal representation is already RFC 6901 encoded, this is a plain move of the inner Cow -- no allocation.

Closes #115.

Test plan

  • cargo test --lib token
  • cargo test --doc token
  • cargo clippy --all-features

Resolves #115: consumers who already own a Cow<str> or String and
want the encoded form back without an extra clone can now call
into_encoded(), which just moves the internal Cow out.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.6%. Comparing base (0018d9e) to head (144fff7).

Additional details and impacted files
Files with missing lines Coverage Δ
src/token.rs 98.3% <100.0%> (+<0.1%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asmello
asmello merged commit 986e5fa into main Jul 26, 2026
21 checks passed
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.

Feature: convert back a Token<'_> into a Cow<'_, str>

2 participants