Skip to content

Commit 73eccdc

Browse files
author
Rob Rix
committed
Merge pull request #18 from ikesyo/reduce
Use reduce in TaskDescription.description
2 parents d14f02e + 109f0dc commit 73eccdc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

ReactiveTask/Task.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ public struct TaskDescription {
4747

4848
extension TaskDescription: Printable {
4949
public var description: String {
50-
var str = "\(launchPath)"
51-
52-
for arg in arguments {
53-
str += " \(arg)"
50+
return arguments.reduce(launchPath) { str, arg in
51+
return str + " \(arg)"
5452
}
55-
56-
return str
5753
}
5854
}
5955

0 commit comments

Comments
 (0)