Change flatmap to map. Because ‘open’ doesn't return an optional.

This commit is contained in:
Kare Morstol
2015-11-12 23:29:43 +01:00
parent 53feebe0e2
commit 280f9e631e
+1 -1
View File
@@ -121,7 +121,7 @@ Everything is mutable, so you can set e.g. the text encoding or reroute standard
```swift
do {
let input = try main.arguments.first.flatMap {try open($0)} ?? main.stdin
let input = try main.arguments.first.map {try open($0)} ?? main.stdin
input.read().characters.split("\n")
.enumerate().map { (linenr,line) in "\(linenr+1): " + String(line) }