summaryrefslogtreecommitdiff
path: root/runtime/ops
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ops')
-rw-r--r--runtime/ops/os.rs5
-rw-r--r--runtime/ops/web_worker.rs7
-rw-r--r--runtime/ops/worker_host.rs6
3 files changed, 6 insertions, 12 deletions
diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs
index ad2ff60ea..c74a423ab 100644
--- a/runtime/ops/os.rs
+++ b/runtime/ops/os.rs
@@ -103,13 +103,12 @@ fn op_delete_env(state: &mut OpState, key: String) -> Result<(), AnyError> {
}
#[op]
-fn op_set_exit_code(state: &mut OpState, code: i32) -> Result<(), AnyError> {
+fn op_set_exit_code(state: &mut OpState, code: i32) {
state.borrow_mut::<Arc<AtomicI32>>().store(code, Relaxed);
- Ok(())
}
#[op]
-fn op_exit(state: &mut OpState) -> Result<(), AnyError> {
+fn op_exit(state: &mut OpState) {
let code = state.borrow::<Arc<AtomicI32>>().load(Relaxed);
std::process::exit(code)
}
diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs
index 4137217bd..184ebfddb 100644
--- a/runtime/ops/web_worker.rs
+++ b/runtime/ops/web_worker.rs
@@ -55,16 +55,15 @@ async fn op_worker_recv_message(
}
#[op]
-fn op_worker_close(state: &mut OpState) -> Result<(), AnyError> {
+fn op_worker_close(state: &mut OpState) {
// Notify parent that we're finished
let mut handle = state.borrow_mut::<WebWorkerInternalHandle>().clone();
handle.terminate();
- Ok(())
}
#[op]
-fn op_worker_get_type(state: &mut OpState) -> Result<WebWorkerType, AnyError> {
+fn op_worker_get_type(state: &mut OpState) -> WebWorkerType {
let handle = state.borrow::<WebWorkerInternalHandle>().clone();
- Ok(handle.worker_type)
+ handle.worker_type
}
diff --git a/runtime/ops/worker_host.rs b/runtime/ops/worker_host.rs
index bd1f1e3f5..f8831d4e9 100644
--- a/runtime/ops/worker_host.rs
+++ b/runtime/ops/worker_host.rs
@@ -258,16 +258,12 @@ fn op_create_worker(
}
#[op]
-fn op_host_terminate_worker(
- state: &mut OpState,
- id: WorkerId,
-) -> Result<(), AnyError> {
+fn op_host_terminate_worker(state: &mut OpState, id: WorkerId) {
if let Some(worker_thread) = state.borrow_mut::<WorkersTable>().remove(&id) {
worker_thread.terminate();
} else {
debug!("tried to terminate non-existent worker {}", id);
}
- Ok(())
}
enum WorkerChannel {