From ed01ecfb5f1e5f5f0a7f027aa33b88025ee1b6bf Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 17 Aug 2023 00:15:34 +0200 Subject: [PATCH] fix: codemp dependency, reverted some changes basically lock it to lib version 0.3 --- .cargo/config | 2 ++ Cargo.toml | 2 +- src/lib.rs | 18 ++++++++---------- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 .cargo/config diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..c91c3f3 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[net] +git-fetch-with-cli = true diff --git a/Cargo.toml b/Cargo.toml index 457e394..d65068e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ exclude = ["index.node"] crate-type = ["cdylib"] [dependencies] -codemp = { path = "../.." } +codemp = { git = "ssh://git@github.com/codewithotherpeopleandchangenamelater/codemp.git", tag = "v0.3" } tracing = "0.1" tracing-subscriber = "0.3" uuid = { version = "1.3.1", features = ["v4"] } diff --git a/src/lib.rs b/src/lib.rs index 4c2794f..f8289c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,12 +3,10 @@ use std::sync::Arc; use neon::prelude::*; use once_cell::sync::OnceCell; use codemp::{ - cursor::controller::{CursorSubscriber, CursorControllerHandle}, - buffer::{ - controller::{OperationControllerHandle, OperationControllerSubscriber}, - client::CodempClient, - factory::OperationFactory, - }, + controller::cursor::{CursorSubscriber, CursorControllerHandle}, + controller::buffer::{OperationControllerHandle, OperationControllerSubscriber}, + client::CodempClient, + factory::OperationFactory, proto::buffer_client::BufferClient, }; use codemp::tokio::{runtime::Runtime, sync::Mutex}; @@ -79,7 +77,7 @@ fn create_client(mut cx: FunctionContext) -> JsResult { let channel = cx.channel(); runtime(&mut cx)?.spawn(async move { - match rc.lock().await.create(&path, content.as_deref()).await { + match rc.lock().await.create(path, content).await { Ok(accepted) => deferred.settle_with(&channel, move |mut cx| Ok(cx.boolean(accepted))), Err(e) => deferred.settle_with(&channel, move |mut cx| cx.throw_error::>(e.to_string())), } @@ -127,7 +125,7 @@ fn attach_client(mut cx: FunctionContext) -> JsResult { let channel = cx.channel(); runtime(&mut cx)?.spawn(async move { - match rc.lock().await.attach(&path).await { + match rc.lock().await.attach(path).await { Ok(controller) => { deferred.settle_with(&channel, move |mut cx| { let obj = cx.empty_object(); @@ -187,7 +185,7 @@ fn callback_operation(mut cx: FunctionContext) -> JsResult { let boxed : Handle> = this.get(&mut cx, "boxed")?; let callback = Arc::new(cx.argument::(0)?.root(&mut cx)); - let rc = boxed.0.clone(); + let mut rc = boxed.0.clone(); let channel = cx.channel(); // TODO when garbage collecting OperationController stop this worker @@ -217,7 +215,7 @@ fn callback_cursor(mut cx: FunctionContext) -> JsResult { let boxed : Handle> = this.get(&mut cx, "boxed")?; let callback = Arc::new(cx.argument::(0)?.root(&mut cx)); - let rc = boxed.0.clone(); + let mut rc = boxed.0.clone(); let channel = cx.channel(); // TODO when garbage collecting OperationController stop this worker