Skip to content

Commit 75b3e03

Browse files
committed
review comment
1 parent 5731604 commit 75b3e03

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ package struct ProtobufCodeGenParser {
9898

9999
extension ProtobufCodeGenParser {
100100
fileprivate func codeDependencies(file: FileDescriptor) -> [Dependency] {
101-
var codeDependencies: [Dependency] = []
102-
103-
if file.services.count > 0 {
104-
codeDependencies.append(Dependency(module: "GRPCProtobuf", accessLevel: .internal))
101+
guard file.services.count > 0 else {
102+
return []
105103
}
106104

105+
var codeDependencies: [Dependency] = [
106+
Dependency(module: "GRPCProtobuf", accessLevel: .internal)
107+
]
107108
// If there's a dependency on a bundled proto then add the SwiftProtobuf import.
108109
//
109110
// Importing SwiftProtobuf unconditionally results in warnings in the generated

0 commit comments

Comments
 (0)