Please help me convert from ->
#[account(mut)]
pub user_token_source: Account<'info, TokenAccount>,
into ->
/// CHECK: Safe. user source token Account. user Account to swap from.
#[account(mut)]
pub user_token_source: UncheckedAccount<'info>,
Tried to convert w/ following w/o success
UncheckedAccount::try_from(
&accounts.user_token_source.to_account_info(),
).clone(),
The error message is
error[E0716]: temporary value dropped while borrowed
--> programs/amm-proxy/src/instructions/swap_base_in.rs:81:18
|
60 | impl<'a, 'b, 'c, 'info> From<&mut ProxySwapBaseIn<'info>>
| ----- lifetime `'info` defined here
...
80 | user_token_source: UncheckedAccount::try_from(
| ________________________________-
81 | | &accounts.user_token_source.to_account_info(),
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
82 | | ).clone(),
| |_____________- argument requires that borrow lasts for `'info`
...
88 | };
| - temporary value is freed at the end of this statement