Skip to content
This repository was archived by the owner on Dec 15, 2024. It is now read-only.

Commit 405f355

Browse files
committed
Updated String extensions
1 parent 9e0f0b0 commit 405f355

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/SwiftFoundation/String.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public extension String {
1414

1515
var string = ""
1616

17-
var generator = data.bytes.makeIterator()
17+
var generator = data.makeIterator()
1818

1919
var encoding = UTF8()
20-
21-
repeat {
2220

21+
repeat {
22+
2323
switch encoding.decode(&generator) {
2424

2525
case let .scalarValue(scalar):
@@ -44,7 +44,7 @@ public extension String {
4444

4545
func toUTF8Data() -> Data {
4646

47-
return Data(bytes: [] + utf8)
47+
return Data(bytes: Array(utf8))
4848
}
4949

5050
func substring(range: Range<Int>) -> String? {

0 commit comments

Comments
 (0)