Skip to content

Commit a0e930f

Browse files
tbkkathomasvl
authored andcommitted
Swift 5.0: Switch a stray Data(bytes:) to Data(_:)
This got missed in a previous pass since the file in question is generated by the Makefile. Incidentally, fix a spelling error. ;-)
1 parent 645b94b commit a0e930f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,10 @@ Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift: build ${PROTOC_G
409409
@rm -f $@
410410
@echo '// See Makefile how this is generated.' >> $@
411411
@echo 'import Foundation' >> $@
412-
@echo 'let fileDesciptorSetBytes: [UInt8] = [' >> $@
412+
@echo 'let fileDescriptorSetBytes: [UInt8] = [' >> $@
413413
@xxd -i < DescriptorTestData.bin >> $@
414414
@echo ']' >> $@
415-
@echo 'let fileDesciptorSetData = Data(bytes: fileDesciptorSetBytes)' >> $@
415+
@echo 'let fileDescriptorSetData = Data(fileDescriptorSetBytes)' >> $@
416416

417417
#
418418
# Collect a list of words that appear in the SwiftProtobuf library

Tests/SwiftProtobufPluginLibraryTests/DescriptorTestData.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// See Makefile how this is generated.
22
import Foundation
3-
let fileDesciptorSetBytes: [UInt8] = [
3+
let fileDescriptorSetBytes: [UInt8] = [
44
0x0a, 0x9b, 0x3b, 0x0a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
55
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73,
66
0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
@@ -845,4 +845,4 @@ let fileDesciptorSetBytes: [UInt8] = [
845845
0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
846846
0x6f, 0x33
847847
]
848-
let fileDesciptorSetData = Data(fileDesciptorSetBytes)
848+
let fileDescriptorSetData = Data(fileDescriptorSetBytes)

Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import SwiftProtobufPluginLibrary
1414
class Test_Descriptor: XCTestCase {
1515

1616
func testParsing() throws {
17-
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDesciptorSetData)
17+
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDescriptorSetData)
1818

1919
let descriptorSet = DescriptorSet(proto: fileSet)
2020
XCTAssertEqual(descriptorSet.files.count, 4)
@@ -73,7 +73,7 @@ class Test_Descriptor: XCTestCase {
7373
}
7474

7575
func testLookup() throws {
76-
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDesciptorSetData)
76+
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDescriptorSetData)
7777

7878
let descriptorSet = DescriptorSet(proto: fileSet)
7979

@@ -91,7 +91,7 @@ class Test_Descriptor: XCTestCase {
9191
}
9292

9393
func testParents() throws {
94-
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDesciptorSetData)
94+
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDescriptorSetData)
9595

9696
let descriptorSet = DescriptorSet(proto: fileSet)
9797

@@ -127,7 +127,7 @@ class Test_Descriptor: XCTestCase {
127127
}
128128

129129
func testFields() throws {
130-
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDesciptorSetData)
130+
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDescriptorSetData)
131131

132132
let descriptorSet = DescriptorSet(proto: fileSet)
133133

@@ -178,7 +178,7 @@ class Test_Descriptor: XCTestCase {
178178
// Extensions are a little different in how they have extensionScope and
179179
// containingType, so they are split out to be a clear test of their behaviors.
180180

181-
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDesciptorSetData)
181+
let fileSet = try Google_Protobuf_FileDescriptorSet(serializedData: fileDescriptorSetData)
182182

183183
let descriptorSet = DescriptorSet(proto: fileSet)
184184

0 commit comments

Comments
 (0)