Skip to content

Use Cow<str> for deserialization map keys in PypiFile and PyxFile#17327

Merged
woodruffw merged 1 commit intoastral-sh:mainfrom
zaniebot:claude/fix-uv-17221-kmH49
Jan 5, 2026
Merged

Use Cow<str> for deserialization map keys in PypiFile and PyxFile#17327
woodruffw merged 1 commit intoastral-sh:mainfrom
zaniebot:claude/fix-uv-17221-kmH49

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Jan 5, 2026

Use Cow<'_, str> when deserializing map keys. This allows serde to borrow strings directly from the input in the common case (no escaping needed), while still correctly handling cases where de-escaping is required.

Addresses feedback from #17221

Replace `String` with `Cow<'_, str>` when deserializing map keys. This
allows serde to borrow strings directly from the input in the common
case (no escaping needed), while still correctly handling cases where
de-escaping is required.

Addresses feedback from astral-sh#17221.
@zaniebot zaniebot force-pushed the claude/fix-uv-17221-kmH49 branch from 13f82e7 to be8b17a Compare January 5, 2026 20:28
@zanieb zanieb marked this pull request as ready for review January 5, 2026 20:54
@zanieb zanieb requested a review from woodruffw January 5, 2026 20:54
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Image

@woodruffw woodruffw merged commit 478c884 into astral-sh:main Jan 5, 2026
102 checks passed
@konstin konstin added the internal A refactor or improvement that is not user-facing label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants