Skip to content

Store comments as u8s instead of Strings#839

Merged
reese merged 1 commit intotrunkfrom
reese-comment-u8
Mar 16, 2026
Merged

Store comments as u8s instead of Strings#839
reese merged 1 commit intotrunkfrom
reese-comment-u8

Conversation

@reese
Copy link
Collaborator

@reese reese commented Mar 4, 2026

Part of #832

On the tin -- this is another spot where we assume UTF-8 compatibility where we should be storing plain bytes. This also does one micro-optimization by making comments a Cow, since we don't modify empty comments (used for spacing) or comments that have no indentation (like at the top of a file) and can keep them as slices instead of allocating a Vec.

@reese reese requested a review from froydnj March 16, 2026 19:39
@reese reese merged commit e85b408 into trunk Mar 16, 2026
9 checks passed
@reese reese deleted the reese-comment-u8 branch March 16, 2026 20:14
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