diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-08-18 18:30:13 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2020-08-19 02:01:48 +0200 |
commit | 27f4aeb92469660fdd78a89a7b2902c08a23ca4a (patch) | |
tree | e2076aaf31f0708e5037f46d3750f93b0d637417 /cli/ops/os.rs | |
parent | de1007fc6a2a6c2909732dcb87a5af6c1e370b09 (diff) |
Make Rc/Arc wrapper around State/GlobalState visible (#7104)
Diffstat (limited to 'cli/ops/os.rs')
-rw-r--r-- | cli/ops/os.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/cli/ops/os.rs b/cli/ops/os.rs index f084f213b..e46aff3e6 100644 --- a/cli/ops/os.rs +++ b/cli/ops/os.rs @@ -6,9 +6,10 @@ use deno_core::CoreIsolate; use deno_core::ZeroCopyBuf; use std::collections::HashMap; use std::env; +use std::rc::Rc; use url::Url; -pub fn init(i: &mut CoreIsolate, s: &State) { +pub fn init(i: &mut CoreIsolate, s: &Rc<State>) { i.register_op("op_exit", s.stateful_json_op(op_exit)); i.register_op("op_env", s.stateful_json_op(op_env)); i.register_op("op_exec_path", s.stateful_json_op(op_exec_path)); @@ -21,7 +22,7 @@ pub fn init(i: &mut CoreIsolate, s: &State) { } fn op_exec_path( - state: &State, + state: &Rc<State>, _args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -41,7 +42,7 @@ struct SetEnv { } fn op_set_env( - state: &State, + state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -52,7 +53,7 @@ fn op_set_env( } fn op_env( - state: &State, + state: &Rc<State>, _args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -67,7 +68,7 @@ struct GetEnv { } fn op_get_env( - state: &State, + state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -86,7 +87,7 @@ struct DeleteEnv { } fn op_delete_env( - state: &State, + state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -102,7 +103,7 @@ struct Exit { } fn op_exit( - _s: &State, + _s: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -111,7 +112,7 @@ fn op_exit( } fn op_loadavg( - state: &State, + state: &Rc<State>, _args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -128,7 +129,7 @@ fn op_loadavg( } fn op_hostname( - state: &State, + state: &Rc<State>, _args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -139,7 +140,7 @@ fn op_hostname( } fn op_os_release( - state: &State, + state: &Rc<State>, _args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { |