Skip to content

Commit 47c27c1

Browse files
Fixed documentation typos
1 parent ad2aadf commit 47c27c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var veryLargeSequence = try await iterator.collect(1024*1024*1024) { sequence ->
122122
}
123123
```
124124

125-
In the above example, our sequence transform gives us access to a sequence that will be at most `1024*1024*1024` bytes large, which is 1 GB! However, instead of accumulating that data into an array, we get a sequence back, which we can attach an iterator map to so we can process the data 1 MB at a time, combining that data into a `DataFrame` type. When, we can consume this transformed sequence, reducing it to calculate averages for each data frame, and storing those averages in a `Summary` object.
125+
In the above example, our sequence transform gives us access to a sequence that will be at most `1024*1024*1024` bytes large, which is 1 GB! However, instead of accumulating that data into an array, we get a sequence back, which we can attach an iterator map to so we can process the data 1 MB at a time, combining that data into a `DataFrame` type. Then, we can consume this transformed sequence, reducing it to calculate averages for each data frame, and storing those averages in a `Summary` object.
126126

127127
Note that this whole time, no more than around 1 MB of memory will be used at a time, because it'll only actually be consumes while reducing the results, which will only read 1 MB of data at a time, and will stop once a total of 1 GB of data has been read.
128128

Sources/AsyncSequenceReader/AsyncReadUpToCountSequence.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extension AsyncIteratorProtocol {
1212
/// Asynchronously advances by the specified number of elements, or ends the sequence if there is no next element.
1313
///
1414
/// If a complete array could not be collected, an error is thrown and the sequence should be considered finished.
15-
/// - Parameter count: The number of bytes to collect.
15+
/// - Parameter count: The number of elements to collect.
1616
/// - Returns: A collection with exactly `count` elements, or `nil` if the sequence is finished.
1717
/// - Throws: `AsyncSequenceReaderError.insufficientElements` if a complete byte sequence could not be returned by the time the sequence ended.
1818
public mutating func collect(_ count: Int) async throws -> [Element]? {

0 commit comments

Comments
 (0)