Move Err() method to Iterator interface, fix fallout

This commit is contained in:
Andrew Dunham 2015-04-15 10:51:22 -07:00
parent 912b126e92
commit accbc6007e
2 changed files with 7 additions and 3 deletions

View file

@ -100,6 +100,9 @@ type Iterator interface {
// Contains returns whether the value is within the set held by the iterator.
Contains(Value) bool
// Err returns the error (if any) encountered during iteration.
Err() error
// Start iteration from the beginning
Reset()
@ -160,9 +163,6 @@ type Nexter interface {
// between the two cases.
Next() bool
// Err returns the error (if any) encountered during iteration.
Err() error
Iterator
}

View file

@ -76,6 +76,10 @@ func (it *Optional) ResultTree() *graph.ResultTree {
return graph.NewResultTree(it.Result())
}
func (it *Optional) Err() error {
return it.subIt.Err()
}
func (it *Optional) Result() graph.Value {
return it.result
}