Skip to content

Commit

Permalink
Prefer if-let shorthand in CountLines.swift (apple#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
KS1019 authored May 9, 2024
1 parent bbcf123 commit 1d191b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Examples/count-lines/CountLines.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct CountLines: AsyncParsableCommand {
extension CountLines {
var fileHandle: FileHandle {
get throws {
guard let inputFile = inputFile else {
guard let inputFile else {
return .standardInput
}
return try FileHandle(forReadingFrom: inputFile)
Expand All @@ -50,7 +50,7 @@ extension CountLines {
print("Lines from stdin", terminator: "")
}

if let prefix = prefix {
if let prefix {
print(", prefixed by '\(prefix)'", terminator: "")
}

Expand Down

0 comments on commit 1d191b0

Please sign in to comment.