From 3f22e1da61d379ca24e92735cae56b1b597dd98b Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 29 Aug 2024 08:40:23 -0400 Subject: [PATCH] Missed comments on https://github.com/apple/swift-protobuf/pull/1704. --- Sources/protoc-gen-swift/Descriptor+Extensions.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/protoc-gen-swift/Descriptor+Extensions.swift b/Sources/protoc-gen-swift/Descriptor+Extensions.swift index 02b9330a0..4b2501d82 100644 --- a/Sources/protoc-gen-swift/Descriptor+Extensions.swift +++ b/Sources/protoc-gen-swift/Descriptor+Extensions.swift @@ -15,7 +15,7 @@ extension FileDescriptor { return SwiftProtobufInfo.isBundledProto(file: self) } - // Returns true if the file will beed to import Foundation. + // Returns true if the file will need to import Foundation. // // `bytes` fields are modeled as `Data`, that is currently the only reason // why the generated sources need to `import Foundation`. @@ -182,6 +182,10 @@ extension Descriptor { /// Returns true if the message should use the message set wireformat. var useMessageSetWireFormat: Bool { return options.messageSetWireFormat } + /// Returns true if the file will need to import Foundation. + /// + /// `bytes` fields are modeled as `Data`, that is currently the only reason + /// why the generated sources need to `import Foundation`. var needsFoundationImport: Bool { if fields.contains(where: { $0.type == .bytes }) { return true