Delete unimplemented Sequence methods from CommitIterator

Implementing these methods is not required to conform to the Sequence protocol, and default implementations are available via standard library extensions on Sequence.
This commit is contained in:
Matt Rubin 2019-04-12 22:57:22 -04:00
parent d878fea696
commit 3db2f74ac4

View File

@ -96,37 +96,4 @@ public class CommitIterator: IteratorProtocol, Sequence {
try body(item)
}
}
private func notImplemented(functionName: Any, file: StaticString = #file, line: UInt = #line) -> Never {
fatalError("CommitIterator does not implement \(functionName)", file: file, line: line)
}
public func dropFirst(_ num: Int) -> AnySequence<Iterator.Element> {
notImplemented(functionName: self.dropFirst)
}
public func dropLast(_ num: Int) -> AnySequence<Iterator.Element> {
notImplemented(functionName: self.dropLast)
}
public func drop(while predicate: (Result<Commit, NSError>) throws -> Bool) rethrows -> AnySequence<Iterator.Element> {
notImplemented(functionName: self.drop)
}
public func prefix(_ maxLength: Int) -> AnySequence<Iterator.Element> {
notImplemented(functionName: "prefix(_ maxLength:")
}
public func prefix(while predicate: (Result<Commit, NSError>) throws -> Bool) rethrows -> AnySequence<Iterator.Element> {
notImplemented(functionName: "prefix(with predicate:")
}
public func suffix(_ maxLength: Int) -> AnySequence<Iterator.Element> {
notImplemented(functionName: self.suffix)
}
public func split(maxSplits: Int, omittingEmptySubsequences: Bool, whereSeparator isSeparator: (Result<Commit, NSError>) throws -> Bool) rethrows -> [AnySequence<Iterator.Element>] {
notImplemented(functionName: self.split)
}
}