diff options
| author | Samrith Shankar <samrith-s@users.noreply.github.com> | 2020-03-20 14:38:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-20 09:38:34 -0400 |
| commit | 798904b0f2ed0c7284b67bba2f125f406b5850de (patch) | |
| tree | 5aba8d35aa8984aa778c894258bcaed56f1ce17c /std/io/readers.ts | |
| parent | 35f6e2e45ddb96524a6bdf54b0a6155caa88d5e0 (diff) | |
Add require-await lint rule (#4401)
Diffstat (limited to 'std/io/readers.ts')
| -rw-r--r-- | std/io/readers.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/io/readers.ts b/std/io/readers.ts index 5b1bf1948..2d81e246f 100644 --- a/std/io/readers.ts +++ b/std/io/readers.ts @@ -9,14 +9,14 @@ export class StringReader implements Reader { constructor(private readonly s: string) {} - async read(p: Uint8Array): Promise<number | Deno.EOF> { + read(p: Uint8Array): Promise<number | Deno.EOF> { const n = Math.min(p.byteLength, this.buf.byteLength - this.offs); p.set(this.buf.slice(this.offs, this.offs + n)); this.offs += n; if (n === 0) { - return Deno.EOF; + return Promise.resolve(Deno.EOF); } - return n; + return Promise.resolve(n); } } |
