Skip to content

Commit

Permalink
Delete unimplemented Sequence methods from CommitIterator
Browse files Browse the repository at this point in the history
Implementing these methods is not required to conform to the Sequence protocol, and default implementations are available via standard library extensions on Sequence.
  • Loading branch information
mattrubin committed Apr 13, 2019
1 parent d878fea commit 3db2f74
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions SwiftGit2/CommitIterator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}

0 comments on commit 3db2f74

Please sign in to comment.