Skip to content

fix(parser): add explicit lifetime to Cow return type (fixes clippy lint)#89

Merged
delexw merged 1 commit into
mainfrom
claude/review-merge-prs-sRT74
May 17, 2026
Merged

fix(parser): add explicit lifetime to Cow return type (fixes clippy lint)#89
delexw merged 1 commit into
mainfrom
claude/review-merge-prs-sRT74

Conversation

@delexw
Copy link
Copy Markdown
Owner

@delexw delexw commented May 17, 2026

Summary

  • Changes Cow<str>Cow<'_, str> in sanitize_lone_surrogates return type
  • Fixes mismatched_lifetime_syntaxes lint that was failing CI under cargo clippy -- -D warnings
  • The elided lifetime on the &str input must be consistently expressed in the return type

Root cause

PR #88 introduced sanitize_lone_surrogates(s: &str) -> Cow<str>. Rust's mismatched_lifetime_syntaxes lint (enabled via -D warnings) requires that the lifetime hidden in &str and the lifetime in Cow<str> be written consistently — either both elided or both explicit. The fix uses Cow<'_, str> to make the connection explicit.


Generated by Claude Code

…e_surrogates

Fixes `mismatched_lifetime_syntaxes` lint: `Cow<str>` → `Cow<'_, str>` makes
the elided lifetime on the `&str` input and the lifetime in the return type
consistent, silencing `-D warnings` under `cargo clippy`.

https://claude.ai/code/session_01Fmh1aPCyB1xMDwNQbk56in
@delexw delexw merged commit 277ed28 into main May 17, 2026
1 check passed
@delexw delexw deleted the claude/review-merge-prs-sRT74 branch May 17, 2026 01:42
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