Skip to content

Commit

Permalink
metadata: Fix cargo clippy (#1574)
Browse files Browse the repository at this point in the history
* metadata: Fix cargo clippy

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

* subxt/backend: Fix clone clippy

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

* tests: Use clone into

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

---------

Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv authored May 6, 2024
1 parent bc079e7 commit a5d94a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion metadata/src/from_into/v14.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ fn generate_outer_enums(
let Some(last) = call_path.last_mut() else {
return Err(TryFromError::InvalidTypePath("RuntimeCall".into()));
};
*last = "RuntimeError".to_owned();
"RuntimeError".clone_into(last);
generate_outer_error_enum_type(metadata, call_path)
};

Expand Down
5 changes: 3 additions & 2 deletions subxt/src/backend/unstable/follow_stream_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ impl<Hash: BlockHash> Shared<Hash> {

shared.seen_runtime_events.clear();

init_message.finalized_block_hashes =
finalized_ev.finalized_block_hashes.clone();
init_message
.finalized_block_hashes
.clone_from(&finalized_ev.finalized_block_hashes);

if let Some(runtime_ev) = newest_runtime {
init_message.finalized_block_runtime = Some(runtime_ev);
Expand Down
2 changes: 1 addition & 1 deletion testing/ui-tests/src/utils/metadata_test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl MetadataTestRunnerCaseBuilder {

/// Set the test name.
pub fn name(mut self, name: impl AsRef<str>) -> Self {
self.name = name.as_ref().to_owned();
name.as_ref().clone_into(&mut self.name);
self
}

Expand Down

0 comments on commit a5d94a4

Please sign in to comment.