Skip to content

Commit

Permalink
pass by reference to avoid clone
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaineHeffron committed May 29, 2024
1 parent 9d8638a commit 0d4b52e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/soroban-cli/src/commands/contract/bindings/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ impl NetworkRunnable for Cmd {
.map_err(|e| Error::CannotParseContractId(self.contract_id.clone(), e))?;
get_remote_contract_spec(
&contract_id,
self.locator.clone(),
self.network.clone(),
&self.locator,
&self.network,
global_args,
config,
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/soroban-cli/src/commands/contract/invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ impl NetworkRunnable for Cmd {

let spec_entries = get_remote_contract_spec(
&contract_id,
unwrap_config.locator.clone(),
unwrap_config.network.clone(),
&unwrap_config.locator,
&unwrap_config.network,
global_args,
config,
)
Expand Down
6 changes: 2 additions & 4 deletions cmd/soroban-cli/src/get_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub async fn get_remote_contract_spec(
};

// Get the contract spec entries based on the executable type
let spec_entries = match executable {
Ok(match executable {
ContractExecutable::Wasm(hash) => {
let hash = hash.to_string();
if let Ok(entries) = data::read_spec(&hash) {
Expand All @@ -74,7 +74,5 @@ pub async fn get_remote_contract_spec(
ContractExecutable::StellarAsset => {
soroban_spec::read::parse_raw(&soroban_sdk::token::StellarAssetSpec::spec_xdr())?
}
};

Ok(spec_entries)
})
}

0 comments on commit 0d4b52e

Please sign in to comment.