Skip to content

Commit 1d191b0

Browse files
authored
Prefer if-let shorthand in CountLines.swift (#638)
1 parent bbcf123 commit 1d191b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Examples/count-lines/CountLines.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct CountLines: AsyncParsableCommand {
3131
extension CountLines {
3232
var fileHandle: FileHandle {
3333
get throws {
34-
guard let inputFile = inputFile else {
34+
guard let inputFile else {
3535
return .standardInput
3636
}
3737
return try FileHandle(forReadingFrom: inputFile)
@@ -50,7 +50,7 @@ extension CountLines {
5050
print("Lines from stdin", terminator: "")
5151
}
5252

53-
if let prefix = prefix {
53+
if let prefix {
5454
print(", prefixed by '\(prefix)'", terminator: "")
5555
}
5656

0 commit comments

Comments
 (0)