Skip to content

Commit

Permalink
fix: clippy and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal authored and gitbutler-client committed Mar 11, 2024
1 parent df57e3b commit fb6b4f5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/soroban-cli/src/commands/config/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn spec_dir() -> Result<std::path::PathBuf, Error> {
Ok(dir)
}

pub fn write(action: Action, rpc_url: Uri) -> Result<ulid::Ulid, Error> {
pub fn write(action: Action, rpc_url: &Uri) -> Result<ulid::Ulid, Error> {
let data = Data {
action,
rpc_url: rpc_url.to_string(),
Expand Down Expand Up @@ -151,7 +151,7 @@ mod test {
let sim = SimulateTransactionResponse::default();
let original_action: Action = sim.into();

let id = write(original_action.clone(), rpc_uri.clone()).unwrap();
let id = write(original_action.clone(), &rpc_uri.clone()).unwrap();
let (action, new_rpc_uri) = read(&id).unwrap();
assert_eq!(rpc_uri, new_rpc_uri);
match (action, original_action) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/deploy/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl NetworkRunnable for Cmd {
.await?
.try_into()?;
if args.map_or(true, |a| !a.no_cache) {
data::write(get_txn_resp, network.rpc_uri()?)?;
data::write(get_txn_resp, &network.rpc_uri()?)?;
}

Ok(stellar_strkey::Contract(contract_id.0).to_string())
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl NetworkRunnable for Cmd {
.await?
.try_into()?;
if global_args.map_or(true, |a| !a.no_cache) {
data::write(get_txn_resp, network.rpc_uri()?)?;
data::write(get_txn_resp, &network.rpc_uri()?)?;
}
Ok(stellar_strkey::Contract(contract_id.0).to_string())
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl NetworkRunnable for Cmd {
.prepare_and_send_transaction(&tx, &key, &[], &network.network_passphrase, None, None)
.await?;
if args.map_or(true, |a| !a.no_cache) {
data::write(res.clone().try_into()?, network.rpc_uri()?)?;
data::write(res.clone().try_into()?, &network.rpc_uri()?)?;
}

let events = res.events()?;
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl NetworkRunnable for Cmd {
.send_assembled_transaction(txn, &key, &[], &network.network_passphrase, None, None)
.await?;
if args.map_or(true, |a| !a.no_cache) {
data::write(txn_resp.clone().try_into().unwrap(), network.rpc_uri()?)?;
data::write(txn_resp.clone().try_into().unwrap(), &network.rpc_uri()?)?;
}
// Currently internal errors are not returned if the contract code is expired
if let Some(TransactionResult {
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 @@ -368,7 +368,7 @@ impl NetworkRunnable for Cmd {
let txn = self.fee.apply_to_assembled_txn(txn);
let sim_res = txn.sim_response();
if global_args.map_or(true, |a| !a.no_cache) {
data::write(sim_res.clone().into(), network.rpc_uri()?)?;
data::write(sim_res.clone().into(), &network.rpc_uri()?)?;
}
let (return_value, events) = if self.is_view() {
(sim_res.results()?[0].xdr.clone(), sim_res.events()?)
Expand All @@ -390,7 +390,7 @@ impl NetworkRunnable for Cmd {
)
.await?;
if !no_cache {
data::write(res.clone().try_into()?, network.rpc_uri()?)?;
data::write(res.clone().try_into()?, &network.rpc_uri()?)?;
}
(res.return_value()?, res.contract_events()?)
};
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl NetworkRunnable for Cmd {
.prepare_and_send_transaction(&tx, &key, &[], &network.network_passphrase, None, None)
.await?;
if args.map_or(true, |a| !a.no_cache) {
data::write(res.clone().try_into()?, network.rpc_uri()?)?;
data::write(res.clone().try_into()?, &network.rpc_uri()?)?;
}
let meta = res
.result_meta
Expand Down

0 comments on commit fb6b4f5

Please sign in to comment.