Skip to content

Commit 835c55c

Browse files
committed
PR changes
1 parent d8e26f2 commit 835c55c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

Sources/SwiftProtobufPluginLibrary/Descriptor.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,7 @@ public final class FileDescriptor {
219219

220220
/// The `Google_Protobuf_FileOptions` set on this file.
221221
@available(*, deprecated, renamed: "options")
222-
public var fileOptions: Google_Protobuf_FileOptions {
223-
get {
224-
self.options
225-
}
226-
}
222+
public var fileOptions: Google_Protobuf_FileOptions { self.options }
227223

228224
/// The `Google_Protobuf_FileOptions` set on this file.
229225
public let options: Google_Protobuf_FileOptions
@@ -528,6 +524,9 @@ public final class Descriptor {
528524
if ordered.count > 1 {
529525
for i in (0..<(ordered.count - 1)).reversed() {
530526
if ordered[i].end == ordered[i+1].start {
527+
// This is why we need `end`'s setter to be `fileprivate` instead of
528+
// having it be a `let`.
529+
// We should turn it back into a let once we get rid of this prop.
531530
ordered[i].end = ordered[i+1].end
532531
ordered.remove(at: i + 1)
533532
}
@@ -577,8 +576,8 @@ public final class Descriptor {
577576
public let reservedNames: [String]
578577

579578
/// True/False if this Message is just for a `map<>` entry.
580-
@available(*, deprecated, message: "Please open a GitHub issue if you think functionality is missing.")
581-
public var isMapEntry: Bool { return proto.options.mapEntry }
579+
@available(*, deprecated, renamed: "options.mapyEntry")
580+
public var isMapEntry: Bool { return options.mapEntry }
582581

583582
/// Returns the `FieldDescriptor`s for the "key" and "value" fields. If
584583
/// this isn't a map entry field, returns nil.
@@ -593,8 +592,8 @@ public final class Descriptor {
593592
// Storage for `file`, will be set by bind()
594593
private unowned var _file: FileDescriptor?
595594

596-
@available(*, deprecated, message: "Please open a GitHub issue if you think functionality is missing.")
597-
public var useMessageSetWireFormat: Bool { return proto.options.messageSetWireFormat }
595+
@available(*, deprecated, renamed: "options.messageSetWireFormat")
596+
public var useMessageSetWireFormat: Bool { return options.messageSetWireFormat }
598597

599598
fileprivate init(proto: Google_Protobuf_DescriptorProto,
600599
index: Int,

Sources/protoc-gen-swift/FieldGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class FieldGeneratorBase {
8989
result = ".standard(proto: \"\(protoName)\")"
9090
} else {
9191
/// The library's generation didn't match, so specify this explicitly.
92-
result = ".unique(proto: \"\(protoName)\", json: \"\(String(describing: jsonName))\")"
92+
result = ".unique(proto: \"\(protoName)\", json: \"\(jsonName ?? "")\")"
9393
}
9494
}
9595

@@ -105,7 +105,7 @@ class FieldGeneratorBase {
105105
if nameLowercase == jsonName {
106106
return [".same(proto: \"\(nameLowercase)\")", result]
107107
} else {
108-
return [".unique(proto: \"\(nameLowercase)\", json: \"\(String(describing: jsonName))\")", result]
108+
return [".unique(proto: \"\(nameLowercase)\", json: \"\(jsonName ?? "")\")", result]
109109
}
110110
} else {
111111
return [result]

0 commit comments

Comments
 (0)