Skip to content

Commit

Permalink
Remove self iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiac committed Aug 29, 2024
1 parent c71f29e commit b5ca5ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/async_result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export class AsyncResult<T, E> implements PromiseLike<Result<T, E>> {
readonly promise: Promise<Result<T, E>> | PromiseLike<Result<T, E>> | AsyncResult<T, E>,
) {}

*[Symbol.iterator](): Iterator<AsyncResult<T, E>, T, any> {
return yield this;
}

async *try(): AsyncGenerator<Err<E, never>, T> {
return yield* await this.promise.then((res) => res.try());
}
Expand Down
5 changes: 0 additions & 5 deletions src/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ export class ResultImpl<T, E> {
this.wrapped = v;
}

*[Symbol.iterator](): Iterator<Result<T, E>, T, any> {
const self = this as unknown as Result<T, E>;
return yield self;
}

public try(): Generator<Err<E, never>, T> {
const wrapped = this.wrapped;
if (this.kind) {
Expand Down

0 comments on commit b5ca5ea

Please sign in to comment.