-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Mark NFD and NFC as SPI #42124
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
Conversation
swiftlang/swift-experimental-string-processing#240 |
underscore Unicode SPI
swiftlang/swift-experimental-string-processing#240 |
Swap the bases to unicodeScalarView
@swift-ci please smoke test |
@swift-ci please benchmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I added a minor note on making initializers explicit
@_spi(_Unicode) | ||
@available(SwiftStdlib 5.7, *) | ||
public struct Iterator { | ||
var base: Unicode._InternalNFD<Substring>.Iterator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@_spi(_Unicode) | ||
@available(SwiftStdlib 5.7, *) | ||
public struct _NFC { | ||
let base: Substring.UnicodeScalarView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@_spi(_Unicode) | ||
@available(SwiftStdlib 5.7, *) | ||
public struct _NFD { | ||
let base: Substring.UnicodeScalarView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid surprises, I recommend spelling out the memberwise initializer here. The compiler-provided one probably works fine, but it usually is a good idea to be explicit about things that might get exposed.
(E.g. I don't know for sure if the implicit initializer will be declared public or internal. internal
would make more sense, but ¯\_(ツ)_/¯)
@_spi(_Unicode) | ||
@available(SwiftStdlib 5.7, *) | ||
public struct Iterator { | ||
var base: Unicode._InternalNFC<Substring>.Iterator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
[stdlib] Mark NFD and NFC as SPI
This marks the normalization utilities NFD and NFC as
@_spi(Unicode)
for use in_StringProcessing
.