From d0d37b1b719003865b2738529d8ea53e6bdbb76b Mon Sep 17 00:00:00 2001 From: frelodev Date: Mon, 12 Feb 2024 19:19:39 +0100 Subject: [PATCH] removed unneeded napi result --- src/rust/buffer.rs | 4 ++-- src/rust/client.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rust/buffer.rs b/src/rust/buffer.rs index b449410..0e267a1 100644 --- a/src/rust/buffer.rs +++ b/src/rust/buffer.rs @@ -79,8 +79,8 @@ impl JsBufferController { #[napi] - pub fn content(&self) -> napi::Result { - Ok(self.0.content()) + pub fn content(&self) -> String { + self.0.content() } diff --git a/src/rust/client.rs b/src/rust/client.rs index 5688c40..2394d40 100644 --- a/src/rust/client.rs +++ b/src/rust/client.rs @@ -33,13 +33,13 @@ impl JsCodempClient { #[napi] /// get workspace with given id, if it exists - pub async fn get_workspace(&self, workspace: String) -> napi::Result> { - Ok(self.0.read().await.get_workspace(&workspace).map(|w| JsWorkspace::from(w))) + pub async fn get_workspace(&self, workspace: String) -> Option { + self.0.read().await.get_workspace(&workspace).map(|w| JsWorkspace::from(w)) } #[napi] /// return current sessions's user id - pub async fn user_id(&self) -> napi::Result { - Ok(self.0.read().await.user_id().to_string()) + pub async fn user_id(&self) -> String { + self.0.read().await.user_id().to_string() } } \ No newline at end of file