mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
chore: various op cleanup (#12329)
This commit is contained in:
parent
d67e858506
commit
77a00ce1fb
26 changed files with 131 additions and 185 deletions
|
@ -1,7 +1,6 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
use data_url::DataUrl;
|
||||
use deno_core::error::null_opbuf;
|
||||
use deno_core::error::type_error;
|
||||
use deno_core::error::AnyError;
|
||||
use deno_core::futures::Future;
|
||||
|
@ -341,10 +340,9 @@ pub async fn op_fetch_send(
|
|||
pub async fn op_fetch_request_write(
|
||||
state: Rc<RefCell<OpState>>,
|
||||
rid: ResourceId,
|
||||
data: Option<ZeroCopyBuf>,
|
||||
data: ZeroCopyBuf,
|
||||
) -> Result<(), AnyError> {
|
||||
let data = data.ok_or_else(null_opbuf)?;
|
||||
let buf = Vec::from(&*data);
|
||||
let buf = data.to_vec();
|
||||
|
||||
let resource = state
|
||||
.borrow()
|
||||
|
@ -362,10 +360,8 @@ pub async fn op_fetch_request_write(
|
|||
pub async fn op_fetch_response_read(
|
||||
state: Rc<RefCell<OpState>>,
|
||||
rid: ResourceId,
|
||||
data: Option<ZeroCopyBuf>,
|
||||
data: ZeroCopyBuf,
|
||||
) -> Result<usize, AnyError> {
|
||||
let data = data.ok_or_else(null_opbuf)?;
|
||||
|
||||
let resource = state
|
||||
.borrow()
|
||||
.resource_table
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue