diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-28 22:44:26 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-28 22:44:26 +0200 |
commit | 9026c578f637fffee792b4397251f0ca4562caa5 (patch) | |
tree | b25728bc374d6e2f8f6bb9a715ebfa02c286648e /src/buffer/buffer.nim | |
parent | 1422f3393301cd6105b3939be194c7c119fcf967 (diff) | |
download | chawan-9026c578f637fffee792b4397251f0ca4562caa5.tar.gz |
refactor: Result[T, JSError] -> JSResult[T]
Diffstat (limited to 'src/buffer/buffer.nim')
-rw-r--r-- | src/buffer/buffer.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim index d36c1f3f..c53641e9 100644 --- a/src/buffer/buffer.nim +++ b/src/buffer/buffer.nim @@ -572,7 +572,7 @@ proc loadResource(buffer: Buffer, elem: HTMLLinkElement): EmptyPromise = let media = parseMediaQueryList(cvals) if not media.applies(document.window): return return buffer.loader.fetch(newRequest(url)) - .then(proc(res: Result[Response, JSError]): Promise[JSResult[string]] = + .then(proc(res: JSResult[Response]): Promise[JSResult[string]] = if res.isOk: let res = res.get #TODO we should use ReadableStreams for this (which would allow us to @@ -598,7 +598,7 @@ proc loadResource(buffer: Buffer, elem: HTMLImageElement): EmptyPromise = if url.isSome: let url = url.get return buffer.loader.fetch(newRequest(url)) - .then(proc(res: Result[Response, JSError]): Promise[JSResult[string]] = + .then(proc(res: JSResult[Response]): Promise[JSResult[string]] = if res.isErr: return let res = res.get |