diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-16 11:05:24 -0400 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-08-16 14:41:08 -0400 |
| commit | 81f809f2a675ff4ff7f93231ca87a18cb5b4628e (patch) | |
| tree | 09a8bd8eedc5b03a4399cdfac896b2d445ed8037 /cli/ops/io.rs | |
| parent | 52a66c2796f97f5a08d679389172c39c0652cb16 (diff) | |
Revert "Remove dead code: legacy read/write ops"
This is causing a segfault for unknown reasons - see #2787.
This reverts commit 498f6ad431478f655b136782093e19e29248b24d.
Diffstat (limited to 'cli/ops/io.rs')
| -rw-r--r-- | cli/ops/io.rs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/cli/ops/io.rs b/cli/ops/io.rs deleted file mode 100644 index 610238942..000000000 --- a/cli/ops/io.rs +++ /dev/null @@ -1,43 +0,0 @@ -use super::dispatch_minimal::MinimalOp; -use crate::deno_error; -use crate::resources; -use crate::tokio_write; -use deno::ErrBox; -use deno::PinnedBuf; -use futures::Future; - -pub fn op_read(rid: i32, zero_copy: Option<PinnedBuf>) -> Box<MinimalOp> { - debug!("read rid={}", rid); - let zero_copy = match zero_copy { - None => { - return Box::new(futures::future::err(deno_error::no_buffer_specified())) - } - Some(buf) => buf, - }; - match resources::lookup(rid as u32) { - None => Box::new(futures::future::err(deno_error::bad_resource())), - Some(resource) => Box::new( - tokio::io::read(resource, zero_copy) - .map_err(ErrBox::from) - .and_then(move |(_resource, _buf, nread)| Ok(nread as i32)), - ), - } -} - -pub fn op_write(rid: i32, zero_copy: Option<PinnedBuf>) -> Box<MinimalOp> { - debug!("write rid={}", rid); - let zero_copy = match zero_copy { - None => { - return Box::new(futures::future::err(deno_error::no_buffer_specified())) - } - Some(buf) => buf, - }; - match resources::lookup(rid as u32) { - None => Box::new(futures::future::err(deno_error::bad_resource())), - Some(resource) => Box::new( - tokio_write::write(resource, zero_copy) - .map_err(ErrBox::from) - .and_then(move |(_resource, _buf, nwritten)| Ok(nwritten as i32)), - ), - } -} |
