summaryrefslogtreecommitdiff
path: root/runtime/ops/http.rs
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-08-15 13:29:19 +0200
committerGitHub <noreply@github.com>2021-08-15 13:29:19 +0200
commit2ca454b402d48c1808f8233c5adedc11b714c63c (patch)
tree592f9e877e9b0ae92be80383ab723cc290e4b01e /runtime/ops/http.rs
parent18ff6bb053d600c277613628a256fe5fdd4dda67 (diff)
refactor(ops): return BadResource errors in ResourceTable calls (#11710)
* refactor(ops): return BadResource errors in ResourceTable calls Instead of relying on callers to map Options to Results via `.ok_or_else(bad_resource_id)` at over 176 different call sites ...
Diffstat (limited to 'runtime/ops/http.rs')
-rw-r--r--runtime/ops/http.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs
index 5b156fc11..58783bbbc 100644
--- a/runtime/ops/http.rs
+++ b/runtime/ops/http.rs
@@ -20,7 +20,7 @@ fn op_http_start(
tcp_stream_rid: ResourceId,
_: (),
) -> Result<ResourceId, AnyError> {
- if let Some(resource_rc) = state
+ if let Ok(resource_rc) = state
.resource_table
.take::<TcpStreamResource>(tcp_stream_rid)
{
@@ -32,7 +32,7 @@ fn op_http_start(
return deno_http::start_http(state, tcp_stream, addr, "http");
}
- if let Some(resource_rc) = state
+ if let Ok(resource_rc) = state
.resource_table
.take::<TlsStreamResource>(tcp_stream_rid)
{