diff options
author | Jae-Heon Ji <32578710+jaeheonji@users.noreply.github.com> | 2021-12-01 05:01:03 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 20:01:03 +0000 |
commit | 4e5717ec6eaf7a1a30214acaa5aeb9bdcea3b32b (patch) | |
tree | ddb961f598b4ca88e5b320d16e2c88cdf8024c98 | |
parent | c3f838a906c4a2e558d9f119af9541e4e07a4520 (diff) |
fix(plugin): mismatch JSON format on `get_zellij_version`
* chore(wasm): comment on target of error
* fix(wasm): formatting the VERSION string
* refactor(wasm): simplify code
* chore: delete comments resolved
* feat(wasm): update write_object fn for generic
-rw-r--r-- | zellij-server/src/wasm_vm.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zellij-server/src/wasm_vm.rs b/zellij-server/src/wasm_vm.rs index 6ee37ad3e..e7e1c68a8 100644 --- a/zellij-server/src/wasm_vm.rs +++ b/zellij-server/src/wasm_vm.rs @@ -313,7 +313,7 @@ fn host_get_plugin_ids(plugin_env: &PluginEnv) { } fn host_get_zellij_version(plugin_env: &PluginEnv) { - wasi_write_string(&plugin_env.wasi_env, VERSION); + wasi_write_object(&plugin_env.wasi_env, VERSION); } fn host_open_file(plugin_env: &PluginEnv) { @@ -397,7 +397,7 @@ pub fn wasi_write_string(wasi_env: &WasiEnv, buf: &str) { writeln!(wasi_file, "{}\r", buf).unwrap(); } -pub fn wasi_write_object(wasi_env: &WasiEnv, object: &impl Serialize) { +pub fn wasi_write_object(wasi_env: &WasiEnv, object: &(impl Serialize + ?Sized)) { wasi_write_string(wasi_env, &serde_json::to_string(&object).unwrap()); } |