Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9467] [String] Mutable conditional access to UTF8View #51929

Open
milseman mannequin opened this issue Dec 11, 2018 · 0 comments
Open

[SR-9467] [String] Mutable conditional access to UTF8View #51929

milseman mannequin opened this issue Dec 11, 2018 · 0 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@milseman
Copy link
Mannequin

milseman mannequin commented Dec 11, 2018

Previous ID SR-9467
Radar None
Original Reporter @milseman
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee @milseman
Priority Medium

md5: 70be96b99799b5808614625fa356ef61

Issue Description:

UTF8View has `withContiguousStorageIfAvailable`, but we would like to add `withContiguousMutableStorageIfAvailable`. The challenge here is that we must validate the contents post-mutation to preserve the validly-encoded UTF-8 contents invariant. However, a `nil` return value communicates that contiguous storage is not available, and even if this wasn't so, we wouldn't want to copy out the entire old contents just in case.

We could consider trapping if the user wrote invalid data in.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

0 participants