Skip to content

Commit

Permalink
Remove redundant clone in auth code. (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh authored May 1, 2023
1 parent 312fea6 commit 1cfa25e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions soroban-env-host/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ pub(crate) struct AuthorizedInvocation {

impl AuthorizedInvocation {
fn from_xdr(xdr_invocation: xdr::AuthorizedInvocation) -> Result<Self, HostError> {
let sub_invocations_xdr = xdr_invocation.sub_invocations.to_vec();
let sub_invocations_xdr = xdr_invocation.sub_invocations.into_vec();
let sub_invocations = sub_invocations_xdr
.into_iter()
.map(|i| AuthorizedInvocation::from_xdr(i))
.collect::<Result<Vec<_>, _>>()?;
Ok(Self {
contract_id: xdr_invocation.contract_id.clone(),
function_name: xdr_invocation.function_name.clone(),
args: xdr_invocation.args.clone(),
contract_id: xdr_invocation.contract_id,
function_name: xdr_invocation.function_name,
args: xdr_invocation.args,
sub_invocations,
is_exhausted: false,
})
Expand Down

0 comments on commit 1cfa25e

Please sign in to comment.