Move Err() method to Iterator interface, fix fallout
This commit is contained in:
parent
912b126e92
commit
accbc6007e
2 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue