File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import Shared
1818 <#Challenge Documentation#>
1919 */
2020@main
21- struct < #ChallengeName#> : ParsableCommand
21+ struct < #ChallengeName#> : AsyncParsableCommand
2222{
2323 /// <#Enumeration for argument which activates "Part Two" behavior#>
2424 enum Mode : String , ExpressibleByArgument , CaseIterable
@@ -36,12 +36,10 @@ struct <#ChallengeName#>: ParsableCommand
3636
3737extension < #ChallengeName#>
3838{
39- mutating func run( ) throws
39+ mutating func run( ) async throws
4040 {
41- while let inputLine = readLine ( )
42- {
43- print ( " \( inputLine) " )
44- }
41+ let input : AsyncLineSequence = FileHandle . standardInput. bytes. lines // URL.homeDirectory.appending(path: "Desktop/input.txt").lines
42+ try await input. reduce ( into: [ ] ) { $0. append ( $1) } . forEach { print ( $0) }
4543 }
4644}
4745
You can’t perform that action at this time.
0 commit comments