From 868208706253e14f1bec44766d9c27d8e80bba47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Wed, 3 May 2023 18:39:01 +0200 Subject: [PATCH] Remove + Send from CallMethod trait, Clippy --- bindings/core/src/method_handler/call_method.rs | 14 ++++---------- bindings/core/src/method_handler/mod.rs | 6 +++--- sdk/src/wallet/wallet/builder.rs | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/bindings/core/src/method_handler/call_method.rs b/bindings/core/src/method_handler/call_method.rs index 95348c3edc..4682e3cd3f 100644 --- a/bindings/core/src/method_handler/call_method.rs +++ b/bindings/core/src/method_handler/call_method.rs @@ -1,10 +1,8 @@ // Copyright 2023 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -#[cfg(not(target_family = "wasm"))] use std::pin::Pin; -#[cfg(not(target_family = "wasm"))] use futures::Future; use iota_sdk::{ client::{secret::SecretManager, Client}, @@ -22,37 +20,33 @@ use crate::{ UtilsMethod, }; -#[cfg(not(target_family = "wasm"))] pub trait CallMethod { type Method; // This uses a manual async_trait-like impl because it's not worth it to import the lib for one trait - fn call_method<'a>(&'a self, method: Self::Method) -> Pin + Send + 'a>>; + fn call_method<'a>(&'a self, method: Self::Method) -> Pin + 'a>>; } -#[cfg(not(target_family = "wasm"))] impl CallMethod for Client { type Method = ClientMethod; - fn call_method<'a>(&'a self, method: Self::Method) -> Pin + Send + 'a>> { + fn call_method<'a>(&'a self, method: Self::Method) -> Pin + 'a>> { Box::pin(call_client_method(self, method)) } } -#[cfg(not(target_family = "wasm"))] impl CallMethod for Wallet { type Method = WalletMethod; - fn call_method<'a>(&'a self, method: Self::Method) -> Pin + Send + 'a>> { + fn call_method<'a>(&'a self, method: Self::Method) -> Pin + 'a>> { Box::pin(call_wallet_method(self, method)) } } -#[cfg(not(target_family = "wasm"))] impl CallMethod for SecretManager { type Method = SecretManagerMethod; - fn call_method<'a>(&'a self, method: Self::Method) -> Pin + Send + 'a>> { + fn call_method<'a>(&'a self, method: Self::Method) -> Pin + 'a>> { Box::pin(call_secret_manager_method(self, method)) } } diff --git a/bindings/core/src/method_handler/mod.rs b/bindings/core/src/method_handler/mod.rs index d29586d765..49be54cf5e 100644 --- a/bindings/core/src/method_handler/mod.rs +++ b/bindings/core/src/method_handler/mod.rs @@ -8,8 +8,8 @@ mod secret_manager; mod utils; mod wallet; -#[cfg(not(target_family = "wasm"))] -pub use call_method::CallMethod; -pub use call_method::{call_client_method, call_secret_manager_method, call_utils_method, call_wallet_method}; +pub use call_method::{ + call_client_method, call_secret_manager_method, call_utils_method, call_wallet_method, CallMethod, +}; #[cfg(feature = "mqtt")] pub use client::listen_mqtt; diff --git a/sdk/src/wallet/wallet/builder.rs b/sdk/src/wallet/wallet/builder.rs index a6d87a4039..1fb7256137 100644 --- a/sdk/src/wallet/wallet/builder.rs +++ b/sdk/src/wallet/wallet/builder.rs @@ -146,7 +146,7 @@ impl WalletBuilder { #[cfg(feature = "storage")] let read_manager_builder = storage_manager.lock().await.get_wallet_data().await?; #[cfg(not(feature = "storage"))] - let read_manager_builder: Option = None; + let read_manager_builder: Option = None; // Prioritize provided client_options and secret_manager over stored ones let new_provided_client_options = if self.client_options.is_none() {