summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-09-09 19:47:05 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-09-10 00:14:28 -0400
commit9bb0627a88077d9bc482b069d7f6a2852b02bb8f (patch)
tree5ba134e96e89287e2e8078b9222799d9f3c424bc /src
parent3afc0b84823581adfc1aa432ab8973afa74346bd (diff)
Remove null_buf()
Diffstat (limited to 'src')
-rw-r--r--src/handlers.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index 6977f100e..ed86c8e50 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -97,7 +97,13 @@ pub extern "C" fn msg_from_js(d: *const DenoC, buf: deno_buf) {
let future = future.and_then(move |maybe_box_u8| {
let buf = match maybe_box_u8 {
Some(box_u8) => deno_buf_from(box_u8),
- None => null_buf(),
+ // Send back null deno_buf.
+ None => deno_buf {
+ alloc_ptr: 0 as *mut u8,
+ alloc_len: 0,
+ data_ptr: 0 as *mut u8,
+ data_len: 0,
+ },
};
// TODO(ry) make this thread safe.
unsafe { libdeno::deno_send(d, buf) };
@@ -118,15 +124,6 @@ fn deno_buf_from(x: Box<[u8]>) -> deno_buf {
}
}
-fn null_buf() -> deno_buf {
- deno_buf {
- alloc_ptr: 0 as *mut u8,
- alloc_len: 0,
- data_ptr: 0 as *mut u8,
- data_len: 0,
- }
-}
-
fn permission_denied() -> DenoError {
DenoError::from(std::io::Error::new(
std::io::ErrorKind::PermissionDenied,