Skip to content

Commit

Permalink
clippy: Remove unneeded ?Sized bound and replace never type with `(…
Browse files Browse the repository at this point in the history
…)` (#1758)

* storage: Remove ?Sized bound

Signed-off-by: Alexandru Vasile <[email protected]>

* backend: Use () instead of !

Signed-off-by: Alexandru Vasile <[email protected]>

* backend: Return directly

Signed-off-by: Alexandru Vasile <[email protected]>

---------

Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv authored Sep 6, 2024
1 parent b8735e5 commit 2471aef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/src/storage/storage_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<K: codec::Encode + ?Sized> StaticStorageKey<K> {
}
}

impl<K: codec::Decode + ?Sized> StaticStorageKey<K> {
impl<K: codec::Decode> StaticStorageKey<K> {
/// Decodes the encoded inner bytes into the type `K`.
pub fn decoded(&self) -> Result<K, Error> {
let decoded = K::decode(&mut self.bytes())?;
Expand Down
3 changes: 1 addition & 2 deletions subxt/src/backend/legacy/rpc_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ impl<T: Config> LegacyRpcMethods<T> {
public: Vec<u8>,
) -> 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.
Expand Down
12 changes: 3 additions & 9 deletions subxt/src/backend/unstable/rpc_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ impl<T: Config> UnstableRpcMethods<T> {
"chainHead_v1_continue",
rpc_params![follow_subscription, operation_id],
)
.await?;

Ok(())
.await
}

/// Stops an operation started with `chainHead_v1_body`, `chainHead_v1_call`, or
Expand All @@ -97,9 +95,7 @@ impl<T: Config> UnstableRpcMethods<T> {
"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.
Expand Down Expand Up @@ -222,9 +218,7 @@ impl<T: Config> UnstableRpcMethods<T> {
) -> Result<(), Error> {
self.client
.request("chainHead_v1_unpin", rpc_params![subscription_id, hash])
.await?;

Ok(())
.await
}

/// Return the genesis hash.
Expand Down

0 comments on commit 2471aef

Please sign in to comment.