Skip to content

Commit ebc37cc

Browse files
committed
gemini has good comments this time
1 parent b78d7e9 commit ebc37cc

11 files changed

Lines changed: 11365 additions & 21786 deletions

File tree

packages/pigeon/example/app/ios/Runner/EventChannelMessages.g.swift

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import Foundation
1414
#error("Unsupported platform.")
1515
#endif
1616

17-
#if DEBUG
18-
func isNullish(_ value: Any?) -> Bool {
17+
enum EventChannelMessagesPigeonInternal {
18+
static func isNullish(_ value: Any?) -> Bool {
1919
guard let innerValue = value else {
2020
return true
2121
}
@@ -26,19 +26,7 @@ import Foundation
2626

2727
return innerValue is NSNull
2828
}
29-
#else
30-
private func isNullish(_ value: Any?) -> Bool {
31-
guard let innerValue = value else {
32-
return true
33-
}
34-
35-
if case Optional<Any>.some(Optional<Any>.none) = value {
36-
return true
37-
}
38-
39-
return innerValue is NSNull
40-
}
41-
#endif
29+
}
4230

4331
private func nilOrValue<T>(_ value: Any?) -> T? {
4432
if value is NSNull { return nil }
@@ -161,7 +149,7 @@ protocol PlatformEvent {
161149
}
162150

163151
/// Generated class from Pigeon that represents data sent in messages.
164-
struct IntEvent: PlatformEvent, CustomStringConvertible {
152+
struct IntEvent: PlatformEvent {
165153
var data: Int64
166154

167155
// swift-format-ignore: AlwaysUseLowerCamelCase
@@ -190,12 +178,12 @@ struct IntEvent: PlatformEvent, CustomStringConvertible {
190178
}
191179

192180
public var description: String {
193-
return "IntEvent(data: \(data))"
181+
return "IntEvent(data: \(String(describing: data)))"
194182
}
195183
}
196184

197185
/// Generated class from Pigeon that represents data sent in messages.
198-
struct StringEvent: PlatformEvent, CustomStringConvertible {
186+
struct StringEvent: PlatformEvent {
199187
var data: String
200188

201189
// swift-format-ignore: AlwaysUseLowerCamelCase
@@ -224,7 +212,7 @@ struct StringEvent: PlatformEvent, CustomStringConvertible {
224212
}
225213

226214
public var description: String {
227-
return "StringEvent(data: \(data))"
215+
return "StringEvent(data: \(String(describing: data)))"
228216
}
229217
}
230218

packages/pigeon/example/app/ios/Runner/Messages.g.swift

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo
6464
details: "")
6565
}
6666

67-
#if DEBUG
68-
func isNullish(_ value: Any?) -> Bool {
67+
enum MessagesPigeonInternal {
68+
static func isNullish(_ value: Any?) -> Bool {
6969
guard let innerValue = value else {
7070
return true
7171
}
@@ -76,19 +76,7 @@ private func createConnectionError(withChannelName channelName: String) -> Pigeo
7676

7777
return innerValue is NSNull
7878
}
79-
#else
80-
private func isNullish(_ value: Any?) -> Bool {
81-
guard let innerValue = value else {
82-
return true
83-
}
84-
85-
if case Optional<Any>.some(Optional<Any>.none) = value {
86-
return true
87-
}
88-
89-
return innerValue is NSNull
90-
}
91-
#endif
79+
}
9280

9381
private func nilOrValue<T>(_ value: Any?) -> T? {
9482
if value is NSNull { return nil }
@@ -256,7 +244,8 @@ struct MessageData: Hashable, CustomStringConvertible {
256244
}
257245

258246
public var description: String {
259-
return "MessageData(name: \(name), description: \(description), code: \(code), data: \(data))"
247+
return
248+
"MessageData(name: \(String(describing: name)), description: \(String(describing: description)), code: \(String(describing: code)), data: \(String(describing: data)))"
260249
}
261250
}
262251

0 commit comments

Comments
 (0)