@@ -136,7 +136,7 @@ extension DirectoryEntries.Batched.AsyncIterator: Sendable {}
136
136
// MARK: - Internal
137
137
138
138
@available ( macOS 10 . 15 , iOS 13 . 0 , watchOS 6 . 0 , tvOS 13 . 0 , * )
139
- extension NIOThrowingAsyncSequenceProducer where Element == [ DirectoryEntry ] , Failure == Error ,
139
+ extension NIOThrowingAsyncSequenceProducer where Element == [ DirectoryEntry ] , Failure == ( any Error ) ,
140
140
Strategy == NIOAsyncSequenceProducerBackPressureStrategies . HighLowWatermark , Delegate == DirectoryEntryProducer {
141
141
fileprivate static func makeBatchedDirectoryEntryStream(
142
142
handle: SystemFileHandle ,
@@ -270,7 +270,6 @@ fileprivate final class DirectoryEntryProducer: NIOAsyncSequenceProducerDelegate
270
270
}
271
271
272
272
private func onNextBatch( _ entries: [ DirectoryEntry ] ) {
273
-
274
273
let source = self . state. withLockedValue { state in
275
274
return state. sequenceProducerSource
276
275
}
@@ -412,7 +411,6 @@ private struct DirectoryEnumerator: Sendable {
412
411
case let . open( threadPool, _, _) :
413
412
return threadPool
414
413
case . openPausedProducing( let threadPool, let source, let array) :
415
- self . state = . modifying
416
414
self . state = . open( threadPool, source, array)
417
415
return threadPool
418
416
case . done:
@@ -424,9 +422,8 @@ private struct DirectoryEnumerator: Sendable {
424
422
425
423
internal mutating func pauseProducing( ) {
426
424
switch self . state {
427
- case . open( let nIOThreadPool, let source, let array) :
428
- self . state = . modifying
429
- self . state = . openPausedProducing( nIOThreadPool, source, array)
425
+ case . open( let threadPool, let source, let array) :
426
+ self . state = . openPausedProducing( threadPool, source, array)
430
427
case . idle:
431
428
( ) // we won't apply back pressure until something has been read
432
429
case . openPausedProducing, . done:
0 commit comments