From daef8f5b81f10734e7360e64e0bb53c3362d634a Mon Sep 17 00:00:00 2001 From: Richard Hua Date: Tue, 5 Dec 2023 11:43:24 +1100 Subject: [PATCH] Successfully building --- bindings_ffi/src/lib.rs | 14 +++++++------- bindings_ffi/src/v2.rs | 4 ++-- .../src/storage/encrypted_store/db_connection.rs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bindings_ffi/src/lib.rs b/bindings_ffi/src/lib.rs index 5a86ca76e..1cabef85e 100644 --- a/bindings_ffi/src/lib.rs +++ b/bindings_ffi/src/lib.rs @@ -9,10 +9,10 @@ use log::info; use logger::FfiLogger; use std::error::Error; use std::sync::Arc; -use uniffi::FfiConverter; + use xmtp_api_grpc::grpc_api_helper::Client as TonicApiClient; use xmtp_mls::groups::MlsGroup; -use xmtp_mls::storage::group_message::{GroupMessageKind, StoredGroupMessage}; +use xmtp_mls::storage::group_message::StoredGroupMessage; use xmtp_mls::types::Address; use xmtp_mls::{ builder::ClientBuilder, @@ -56,7 +56,7 @@ impl From for GenericError { } // TODO Use non-string errors across Uniffi interface -fn stringify_error_chain(error: &(dyn Error + 'static)) -> String { +fn stringify_error_chain(error: &T) -> String { let mut result = format!("Error: {}\n", error); let mut source = error.source(); @@ -103,7 +103,7 @@ pub async fn create_client( } }?; - let mut xmtp_client: RustXmtpClient = ClientBuilder::new(inbox_owner.into()) + let xmtp_client: RustXmtpClient = ClientBuilder::new(inbox_owner.into()) .api_client(api_client) .store(store) .build()?; @@ -144,7 +144,7 @@ pub struct FfiConversations { impl FfiConversations { pub async fn create_group( &self, - account_address: String, + _account_address: String, ) -> Result, GenericError> { let convo = self.inner_client.create_group()?; @@ -285,7 +285,7 @@ mod tests { use crate::{ create_client, inbox_owner::SigningError, logger::FfiLogger, static_enc_key, FfiInboxOwner, - FfiListMessagesOptions, FfiXmtpClient, + FfiXmtpClient, }; use ethers_core::rand::{ self, @@ -411,7 +411,7 @@ mod tests { Box::new(ffi_inbox_owner.clone()), xmtp_api_grpc::LOCALHOST_ADDRESS.to_string(), false, - Some(path), + Some(path.clone()), Some(key), ) .await diff --git a/bindings_ffi/src/v2.rs b/bindings_ffi/src/v2.rs index 4d9f44720..f241bab12 100644 --- a/bindings_ffi/src/v2.rs +++ b/bindings_ffi/src/v2.rs @@ -1,4 +1,4 @@ -use crate::{stringify_error_chain, GenericError}; +use crate::GenericError; #[uniffi::export] pub fn recover_address( @@ -9,7 +9,7 @@ pub fn recover_address( xmtp_cryptography::signature::RecoverableSignature::Eip191Signature(signature_bytes); let recovered = signature.recover_address(&predigest_message)?; - return Ok(recovered); + Ok(recovered) } #[uniffi::export] diff --git a/xmtp_mls/src/storage/encrypted_store/db_connection.rs b/xmtp_mls/src/storage/encrypted_store/db_connection.rs index 7e04f95ea..07f111630 100644 --- a/xmtp_mls/src/storage/encrypted_store/db_connection.rs +++ b/xmtp_mls/src/storage/encrypted_store/db_connection.rs @@ -1,5 +1,5 @@ use crate::storage::RawDbConnection; -use std::{cell::RefCell, fmt, sync::Mutex}; +use std::{fmt, sync::Mutex}; // Re-implementation of Cow without ToOwned requirement enum RefOrValue<'a, T> {