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/tty.rs | |
parent | de1007fc6a2a6c2909732dcb87a5af6c1e370b09 (diff) |
Make Rc/Arc wrapper around State/GlobalState visible (#7104)
Diffstat (limited to 'cli/ops/tty.rs')
-rw-r--r-- | cli/ops/tty.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/ops/tty.rs b/cli/ops/tty.rs index d86100232..d6aaeb785 100644 --- a/cli/ops/tty.rs +++ b/cli/ops/tty.rs @@ -10,6 +10,7 @@ use deno_core::ZeroCopyBuf; use nix::sys::termios; use serde_derive::{Deserialize, Serialize}; use serde_json::Value; +use std::rc::Rc; #[cfg(windows)] use winapi::shared::minwindef::DWORD; @@ -35,7 +36,7 @@ fn get_windows_handle( Ok(handle) } -pub fn init(i: &mut CoreIsolate, s: &State) { +pub fn init(i: &mut CoreIsolate, s: &Rc<State>) { i.register_op("op_set_raw", s.stateful_json_op2(op_set_raw)); i.register_op("op_isatty", s.stateful_json_op2(op_isatty)); i.register_op("op_console_size", s.stateful_json_op2(op_console_size)); @@ -49,7 +50,7 @@ struct SetRawArgs { pub fn op_set_raw( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -218,7 +219,7 @@ struct IsattyArgs { pub fn op_isatty( isolate_state: &mut CoreIsolateState, - _state: &State, + _state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { @@ -265,7 +266,7 @@ struct ConsoleSize { pub fn op_console_size( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result<JsonOp, OpError> { |