Skip to content

Commit c008d35

Browse files
authored
Fix warnings in command plugin (#87)
Motivation: The command plugin had a couple of warnings as vars weren't mutated. Modifications: - Change some vars to lets - Remove an unused string Result: No warnings
1 parent 10b648d commit c008d35

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Plugins/GRPCProtobufGeneratorCommand/CommandPluginError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extension CommandPluginError: CustomStringConvertible {
7171
var iterator = arguments.makeIterator()
7272
var current = iterator.next()
7373
while let currentArg = current {
74-
var nextArg = iterator.next()
74+
let nextArg = iterator.next()
7575
defer { current = nextArg }
7676

7777
if nextArg != nil {

Plugins/GRPCProtobufGeneratorCommand/Plugin.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct GRPCProtobufGeneratorCommandPlugin {
180180
} else if isDirectory.boolValue {
181181
dirs.append(file)
182182
// Do a deep traversal of the directory.
183-
if var enumerator = fileManager.enumerator(atPath: file) {
183+
if let enumerator = fileManager.enumerator(atPath: file) {
184184
while let path = enumerator.nextObject() as? String {
185185
if path.hasSuffix(".proto") {
186186
protos.append(path)
@@ -262,7 +262,6 @@ func executeProtocInvocation(
262262
} else {
263263
stdErr = nil
264264
}
265-
let problem = "\(process.terminationReason):\(process.terminationStatus)"
266265
throw CommandPluginError.generationFailure(
267266
executable: executableURL.absoluteStringNoScheme,
268267
arguments: arguments,

0 commit comments

Comments
 (0)