Skip to content

Commit 4cf2907

Browse files
committed
stopped derefrencing
1 parent ea0c113 commit 4cf2907

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

program/rust/src/log.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use solana_program::sysvar::Sysvar;
1414
pub fn pre_log(accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResult {
1515
msg!("Pyth oracle contract");
1616

17-
let instruction_header: cmd_hdr = *load::<cmd_hdr>(instruction_data)?;
17+
let instruction_header: &cmd_hdr = load::<cmd_hdr>(instruction_data)?;
1818
let instruction_id: u32 = instruction_header
1919
.cmd_
2020
.try_into()
@@ -23,7 +23,7 @@ pub fn pre_log(accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResu
2323

2424
match instruction_id {
2525
command_t_e_cmd_upd_price | command_t_e_cmd_agg_price => {
26-
let instruction: cmd_upd_price = *load::<cmd_upd_price>(instruction_data)?;
26+
let instruction: &cmd_upd_price = load::<cmd_upd_price>(instruction_data)?;
2727
// Account 1 is price_info in this instruction
2828
let price_account = load_account_as::<pc_price_t>(&accounts[1])?;
2929
msg!(
@@ -41,7 +41,7 @@ pub fn pre_log(accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResu
4141
);
4242
}
4343
command_t_e_cmd_upd_price_no_fail_on_error => {
44-
let instruction: cmd_upd_price = *load::<cmd_upd_price>(instruction_data)?;
44+
let instruction: &cmd_upd_price = load::<cmd_upd_price>(instruction_data)?;
4545
// Account 1 is price_info in this instruction
4646
let price_account = load_account_as::<pc_price_t>(&accounts[1])?;
4747
msg!(

0 commit comments

Comments
 (0)