A very small question. When I try to map a throwing function in Swift, the compiler makes me use the try keyword twice. For a toy example:
public func combineFiles(files: [String]) throws -> String {
let strings = try files.map { try String(contentsOfFile: $0) }
return strings.joined(separator: "\n\n")
}
Both of the try keywords in the second line seem to be necessary in order to get this to compile. But this just feels super-wrong to me---is there a way to do this kind of operation without a second try statement?