Skip to content

Commit 3a17834

Browse files
committed
Move String additions from _FoundationInternals to FoundationEssentials + package
1 parent 30bc5b9 commit 3a17834

File tree

7 files changed

+5
-5
lines changed

7 files changed

+5
-5
lines changed

Sources/_FoundationInternals/String/String+Comparison.swift renamed to Sources/FoundationEssentials/String/String+Comparison.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ extension Substring {
643643
}
644644

645645
// Only throws when using `.regularExpression` option
646-
func _enumerateComponents(separatedBy separator: Substring, options: String.CompareOptions = [], withBlock block: (_ component: Substring, _ isLastComponent: Bool) -> ()) throws {
646+
package func _enumerateComponents(separatedBy separator: Substring, options: String.CompareOptions, withBlock block: (_ component: Substring, _ isLastComponent: Bool) -> ()) throws {
647647
var searchStart = startIndex
648648
while searchStart < endIndex {
649649
let r = try self[searchStart...]._range(of: separator, options: options)

Sources/_FoundationInternals/String/String+Internals.swift renamed to Sources/FoundationEssentials/String/String+Internals.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
extension String {
14-
internal func _trimmingWhitespace() -> String {
14+
package func _trimmingWhitespace() -> String {
1515
String(unicodeScalars._trimmingCharacters {
1616
$0.properties.isWhitespace
1717
})
1818
}
1919

20-
internal init?(_utf16 input: UnsafeBufferPointer<UInt16>) {
20+
package init?(_utf16 input: UnsafeBufferPointer<UInt16>) {
2121
// Allocate input.count * 3 code points since one UTF16 code point may require up to three UTF8 code points when transcoded
2222
let str = withUnsafeTemporaryAllocation(of: UTF8.CodeUnit.self, capacity: input.count * 3) { contents in
2323
var count = 0
@@ -39,14 +39,14 @@ extension String {
3939
self = str
4040
}
4141

42-
internal init?(_utf16 input: UnsafeMutableBufferPointer<UInt16>, count: Int) {
42+
package init?(_utf16 input: UnsafeMutableBufferPointer<UInt16>, count: Int) {
4343
guard let str = String(_utf16: UnsafeBufferPointer(rebasing: input[..<count])) else {
4444
return nil
4545
}
4646
self = str
4747
}
4848

49-
internal init?(_utf16 input: UnsafePointer<UInt16>, count: Int) {
49+
package init?(_utf16 input: UnsafePointer<UInt16>, count: Int) {
5050
guard let str = String(_utf16: UnsafeBufferPointer(start: input, count: count)) else {
5151
return nil
5252
}

0 commit comments

Comments
 (0)