allow EventLoopIterator to be constructed using [EventLoop] (#706)

Motivation:

Modules outside of NIO core must be able to create `EventLoopIterator`s
in order to conform to the `EventLoop` protocol, therefore we need an
initialiser that's available.

Modifications:

add public initialiser to construct EventLoopIterator from [EventLoop]

Result:

others can implement EventLoops again
This commit is contained in:
Johannes Weiss authored and Cory Benfield committed 2018-12-14 16:13:17 +00:00
1 parent ee6534f627
commit 1ac199c195
1 file changed
+2 -1
+2 -1
View File
@@ -155,7 +155,8 @@ public struct EventLoopIterator: Sequence, IteratorProtocol {
public typealias Element = EventLoop
private var eventLoops: IndexingIterator<[EventLoop]>
internal init(_ eventLoops: [EventLoop]) {
/// Create an `EventLoopIterator` from an array of `EventLoop`s.
public init(_ eventLoops: [EventLoop]) {
self.eventLoops = eventLoops.makeIterator()
}