From 2471aefe3bde96e3edbd5e868a56a622fb10a80b Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Fri, 6 Sep 2024 18:14:40 +0300 Subject: [PATCH] clippy: Remove unneeded `?Sized` bound and replace never type with `()` (#1758) * storage: Remove ?Sized bound Signed-off-by: Alexandru Vasile * backend: Use () instead of ! Signed-off-by: Alexandru Vasile * backend: Return directly Signed-off-by: Alexandru Vasile --------- Signed-off-by: Alexandru Vasile --- core/src/storage/storage_key.rs | 2 +- subxt/src/backend/legacy/rpc_methods.rs | 3 +-- subxt/src/backend/unstable/rpc_methods.rs | 12 +++--------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/core/src/storage/storage_key.rs b/core/src/storage/storage_key.rs index b5f7b58d7c..6ecd20180b 100644 --- a/core/src/storage/storage_key.rs +++ b/core/src/storage/storage_key.rs @@ -182,7 +182,7 @@ impl StaticStorageKey { } } -impl StaticStorageKey { +impl StaticStorageKey { /// Decodes the encoded inner bytes into the type `K`. pub fn decoded(&self) -> Result { let decoded = K::decode(&mut self.bytes())?; diff --git a/subxt/src/backend/legacy/rpc_methods.rs b/subxt/src/backend/legacy/rpc_methods.rs index 25a9888a1d..72b328111a 100644 --- a/subxt/src/backend/legacy/rpc_methods.rs +++ b/subxt/src/backend/legacy/rpc_methods.rs @@ -332,8 +332,7 @@ impl LegacyRpcMethods { public: Vec, ) -> Result<(), Error> { let params = rpc_params![key_type, suri, Bytes(public)]; - self.client.request("author_insertKey", params).await?; - Ok(()) + self.client.request("author_insertKey", params).await } /// Generate new session keys and returns the corresponding public keys. diff --git a/subxt/src/backend/unstable/rpc_methods.rs b/subxt/src/backend/unstable/rpc_methods.rs index 524b37bf82..e72f2cadef 100644 --- a/subxt/src/backend/unstable/rpc_methods.rs +++ b/subxt/src/backend/unstable/rpc_methods.rs @@ -77,9 +77,7 @@ impl UnstableRpcMethods { "chainHead_v1_continue", rpc_params![follow_subscription, operation_id], ) - .await?; - - Ok(()) + .await } /// Stops an operation started with `chainHead_v1_body`, `chainHead_v1_call`, or @@ -97,9 +95,7 @@ impl UnstableRpcMethods { "chainHead_v1_stopOperation", rpc_params![follow_subscription, operation_id], ) - .await?; - - Ok(()) + .await } /// Call the `chainHead_v1_body` method and return an operation ID to obtain the block's body. @@ -222,9 +218,7 @@ impl UnstableRpcMethods { ) -> Result<(), Error> { self.client .request("chainHead_v1_unpin", rpc_params![subscription_id, hash]) - .await?; - - Ok(()) + .await } /// Return the genesis hash.