feat: new parser strategy
This commit is contained in:
@@ -81,10 +81,10 @@ func (i Iterator[T]) Done() bool {
|
||||
return i.index == len(i.items)
|
||||
}
|
||||
|
||||
// Do attempts to perform an operation using the iterator. If the operation
|
||||
// Try attempts to perform an operation using the iterator. If the operation
|
||||
// succeeds, the iterator is updated. If the operation fails, the iterator is
|
||||
// rolled back, and an error is returned.
|
||||
func Do[T any, U any](i *Iterator[T], fn func(i *Iterator[T]) (U, error)) (U, error) {
|
||||
func Try[T any, U any](i *Iterator[T], fn func(i *Iterator[T]) (U, error)) (U, error) {
|
||||
i2 := i.Copy()
|
||||
|
||||
out, err := fn(i2)
|
||||
|
||||
Reference in New Issue
Block a user