Skip to content

Commit 382a402

Browse files
committed
Fix for string based codingkeys
1 parent c209116 commit 382a402

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Sources/swift-csv/AsyncCodableCSVIterator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public struct AsyncCodableCSVIterator<T: Decodable, Encoding: _UnicodeEncoding>:
4949

5050
self.iterator = iterator
5151
self.headers = iterator.headers
52-
self.lineDecoder = CSVLineDecoder(data: .init(booleanDecodingBehavior: booleanDecodingBehavior))
52+
self.lineDecoder = CSVLineDecoder(data: .init(headers: iterator.headers, booleanDecodingBehavior: booleanDecodingBehavior))
5353
}
5454

5555
public mutating func next() async throws -> Element? {

Sources/swift-csv/CSVLineDecoder.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ extension CSVLineDecoder {
4040
var tempData: [String] = []
4141
let booleanDecodingBehavior: BooleanDecodingBehavior
4242

43-
init(booleanDecodingBehavior: BooleanDecodingBehavior) {
43+
init(headers: [String]?, booleanDecodingBehavior: BooleanDecodingBehavior) {
44+
self.headers = headers
4445
self.booleanDecodingBehavior = booleanDecodingBehavior
4546
}
4647
}

0 commit comments

Comments
 (0)