From 95f800c762ec5175d1740e64df9ef458b2c9dcff Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 25 Sep 2024 22:53:32 +0200 Subject: [PATCH 1/4] fix: doctests fail with features enabled, dont run --- src/api/change.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/change.rs b/src/api/change.rs index fe1e3e2..5a2ebfe 100644 --- a/src/api/change.rs +++ b/src/api/change.rs @@ -20,7 +20,7 @@ /// To delete a the fourth character we should send a. /// `TextChange { start: 3, end: 4, content: "".into(), hash: None }` /// -/// ``` +/// ```no_run /// let change = codemp::api::TextChange { /// start: 6, end: 11, /// content: "mom".to_string(), hash: None From 297762c0b417ea3b5f7751f5ac105f5e24b63d72 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 25 Sep 2024 22:56:07 +0200 Subject: [PATCH 2/4] fix(js): wrong argument, also remove Result<> --- src/ffi/js/ext.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ffi/js/ext.rs b/src/ffi/js/ext.rs index a9a94d6..73795ac 100644 --- a/src/ffi/js/ext.rs +++ b/src/ffi/js/ext.rs @@ -2,11 +2,11 @@ use napi_derive::napi; #[napi(js_name = "hash")] -pub fn js_hash(str : String) -> napi::Result{ - Ok(crate::ext::hash(str)) +pub fn js_hash(data: String) -> i64 { + crate::ext::hash(data) } #[napi(js_name = "version")] -pub fn js_version(str : String) -> napi::Result{ - Ok(crate::version()) -} \ No newline at end of file +pub fn js_version() -> String { + crate::version() +} From 79f063123eace57ef4002286c1bc63f009536186 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 25 Sep 2024 22:56:37 +0200 Subject: [PATCH 3/4] chore: bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- dist/java/build.gradle | 2 +- dist/js/package.json | 8 ++++---- .../{codemp-0.7.0-1.rockspec => codemp-0.7.1-1.rockspec} | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) rename dist/lua/{codemp-0.7.0-1.rockspec => codemp-0.7.1-1.rockspec} (95%) diff --git a/Cargo.lock b/Cargo.lock index f7af2d8..b0c5601 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,7 +231,7 @@ dependencies = [ [[package]] name = "codemp" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-trait", "codemp-proto", diff --git a/Cargo.toml b/Cargo.toml index 73d2499..bccd240 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ authors = [ ] license = "GPL-3.0-only" edition = "2021" -version = "0.7.0" +version = "0.7.1" exclude = ["dist/*"] [lib] diff --git a/dist/java/build.gradle b/dist/java/build.gradle index 09e9b43..c5348bc 100644 --- a/dist/java/build.gradle +++ b/dist/java/build.gradle @@ -5,7 +5,7 @@ plugins { } group = 'mp.code' -version = '0.7.0' +version = '0.7.1' java { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11 diff --git a/dist/js/package.json b/dist/js/package.json index 95da5e0..4af1134 100644 --- a/dist/js/package.json +++ b/dist/js/package.json @@ -1,6 +1,6 @@ { "name": "@codemp/native", - "version": "0.7.0", + "version": "0.7.1", "description": "code multiplexer -- javascript bindings", "keywords": [ "codemp", @@ -35,8 +35,8 @@ } }, "optionalDependencies": { - "@codemp/native-win32-x64-msvc": "0.7.0", - "@codemp/native-darwin-arm64": "0.7.0", - "@codemp/native-linux-x64-gnu": "0.7.0" + "@codemp/native-win32-x64-msvc": "0.7.1", + "@codemp/native-darwin-arm64": "0.7.1", + "@codemp/native-linux-x64-gnu": "0.7.1" } } diff --git a/dist/lua/codemp-0.7.0-1.rockspec b/dist/lua/codemp-0.7.1-1.rockspec similarity index 95% rename from dist/lua/codemp-0.7.0-1.rockspec rename to dist/lua/codemp-0.7.1-1.rockspec index db2ce77..079a898 100644 --- a/dist/lua/codemp-0.7.0-1.rockspec +++ b/dist/lua/codemp-0.7.1-1.rockspec @@ -1,9 +1,9 @@ package = "codemp" -version = "0.7.0-1" +version = "0.7.1-1" source = { url = "git+https://github.com/hexedtech/codemp", - tag = "v0.7.0", + tag = "v0.7.1", } dependencies = { From 4191fc2257c1654ff0306d26435f5455e91210c2 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 25 Sep 2024 23:00:01 +0200 Subject: [PATCH 4/4] fix(js): remove unneded result wraps --- src/ffi/js/buffer.rs | 7 +++---- src/ffi/js/client.rs | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ffi/js/buffer.rs b/src/ffi/js/buffer.rs index 583370f..b93f3c7 100644 --- a/src/ffi/js/buffer.rs +++ b/src/ffi/js/buffer.rs @@ -27,15 +27,14 @@ impl BufferController { } #[napi(js_name = "clear_callback")] - pub fn js_clear_callback(&self) -> napi::Result<()> { + pub fn js_clear_callback(&self) -> () { self.clear_callback(); - Ok(()) } #[napi(js_name = "get_path")] - pub fn js_path(&self) -> napi::Result<&str> { - Ok(self.path()) + pub fn js_path(&self) -> &str { + self.path() } #[napi(js_name = "poll")] diff --git a/src/ffi/js/client.rs b/src/ffi/js/client.rs index 8f5efab..c1ea64f 100644 --- a/src/ffi/js/client.rs +++ b/src/ffi/js/client.rs @@ -41,8 +41,8 @@ impl Client { #[napi(js_name = "leave_workspace")] /// leave workspace and disconnect, returns true if workspace was active - pub async fn js_leave_workspace(&self, workspace: String) -> napi::Result { - Ok(self.leave_workspace(&workspace)) + pub async fn js_leave_workspace(&self, workspace: String) -> bool { + self.leave_workspace(&workspace) } #[napi(js_name = "get_workspace")]