From 1fb1a8ba36f7a04a5c49c898de1718cd7d0f598a Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Sat, 16 Nov 2024 16:45:44 +0100 Subject: [PATCH] ffi: fix "'unsigned' is a keyword" error on Swift Package Signed-off-by: Yuki Kishimoto --- bindings/nostr-sdk-ffi/src/connect.rs | 4 ++-- bindings/nostr-sdk-ffi/src/protocol/key/mod.rs | 4 ++-- bindings/nostr-sdk-ffi/src/protocol/signer.rs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/nostr-sdk-ffi/src/connect.rs b/bindings/nostr-sdk-ffi/src/connect.rs index fe3a2e5fa..aeda6b784 100644 --- a/bindings/nostr-sdk-ffi/src/connect.rs +++ b/bindings/nostr-sdk-ffi/src/connect.rs @@ -82,10 +82,10 @@ impl NostrSigner for NostrConnect { Ok(Some(Arc::new(self.inner.get_public_key().await?.into()))) } - async fn sign_event(&self, unsigned: Arc) -> Result>> { + async fn sign_event(&self, unsigned_event: Arc) -> Result>> { Ok(Some(Arc::new( self.inner - .sign_event(unsigned.as_ref().deref().clone()) + .sign_event(unsigned_event.as_ref().deref().clone()) .await? .into(), ))) diff --git a/bindings/nostr-sdk-ffi/src/protocol/key/mod.rs b/bindings/nostr-sdk-ffi/src/protocol/key/mod.rs index a79195fc8..e903006f4 100644 --- a/bindings/nostr-sdk-ffi/src/protocol/key/mod.rs +++ b/bindings/nostr-sdk-ffi/src/protocol/key/mod.rs @@ -125,10 +125,10 @@ impl NostrSigner for Keys { Ok(Some(Arc::new(self.inner.get_public_key().await?.into()))) } - async fn sign_event(&self, unsigned: Arc) -> Result>> { + async fn sign_event(&self, unsigned_event: Arc) -> Result>> { Ok(Some(Arc::new( self.inner - .sign_event(unsigned.as_ref().deref().clone()) + .sign_event(unsigned_event.as_ref().deref().clone()) .await? .into(), ))) diff --git a/bindings/nostr-sdk-ffi/src/protocol/signer.rs b/bindings/nostr-sdk-ffi/src/protocol/signer.rs index 23d866817..ed14e1acc 100644 --- a/bindings/nostr-sdk-ffi/src/protocol/signer.rs +++ b/bindings/nostr-sdk-ffi/src/protocol/signer.rs @@ -65,7 +65,7 @@ pub trait NostrSigner: Send + Sync { async fn get_public_key(&self) -> Result>>; /// Sign an unsigned event - async fn sign_event(&self, unsigned: Arc) -> Result>>; + async fn sign_event(&self, unsigned_event: Arc) -> Result>>; /// NIP04 encrypt (deprecate and unsecure) async fn nip04_encrypt(&self, public_key: Arc, content: String) -> Result; @@ -101,11 +101,11 @@ impl NostrSignerFFI2Rust { } pub struct NostrSignerRust2FFI { - pub(super) inner: Arc, + pub(super) inner: Arc, } impl NostrSignerRust2FFI { - pub fn new(inner: Arc) -> Self { + pub fn new(inner: Arc) -> Self { Self { inner } } } @@ -120,10 +120,10 @@ impl NostrSigner for NostrSignerRust2FFI { Ok(Some(Arc::new(self.inner.get_public_key().await?.into()))) } - async fn sign_event(&self, unsigned: Arc) -> Result>> { + async fn sign_event(&self, unsigned_event: Arc) -> Result>> { Ok(Some(Arc::new( self.inner - .sign_event(unsigned.as_ref().deref().clone()) + .sign_event(unsigned_event.as_ref().deref().clone()) .await? .into(), )))