From b5ca5eafc9d3c4cb7108ce0f017c1ee6d8eda530 Mon Sep 17 00:00:00 2001 From: bkiac Date: Thu, 29 Aug 2024 11:46:05 +0200 Subject: [PATCH] Remove self iterators --- src/async_result.ts | 4 ---- src/result.ts | 5 ----- 2 files changed, 9 deletions(-) diff --git a/src/async_result.ts b/src/async_result.ts index 63b5c5c..6fa3c05 100644 --- a/src/async_result.ts +++ b/src/async_result.ts @@ -11,10 +11,6 @@ export class AsyncResult implements PromiseLike> { readonly promise: Promise> | PromiseLike> | AsyncResult, ) {} - *[Symbol.iterator](): Iterator, T, any> { - return yield this; - } - async *try(): AsyncGenerator, T> { return yield* await this.promise.then((res) => res.try()); } diff --git a/src/result.ts b/src/result.ts index 032fb22..2693096 100644 --- a/src/result.ts +++ b/src/result.ts @@ -26,11 +26,6 @@ export class ResultImpl { this.wrapped = v; } - *[Symbol.iterator](): Iterator, T, any> { - const self = this as unknown as Result; - return yield self; - } - public try(): Generator, T> { const wrapped = this.wrapped; if (this.kind) {