More nightly clippy fixes

This commit is contained in:
Michael Vines 2021-06-18 14:06:14 -07:00
parent 4a12c715a3
commit 1b7f6d2bc0
5 changed files with 7 additions and 15 deletions

View File

@ -21,16 +21,8 @@ fn process_instruction(
let mut lamports = accounts[0].lamports(); let mut lamports = accounts[0].lamports();
let owner = &accounts[0].owner; let owner = &accounts[0].owner;
let mut data = accounts[0].try_borrow_mut_data()?; let mut data = accounts[0].try_borrow_mut_data()?;
let account = AccountInfo::new( let account =
&key, AccountInfo::new(&key, false, false, &mut lamports, &mut data, owner, true, 0);
false,
false,
&mut lamports,
&mut data,
&owner,
true,
0,
);
msg!("{:?} calling {:?}", program_id, key); msg!("{:?} calling {:?}", program_id, key);
invoke(&ix, &[account])?; invoke(&ix, &[account])?;
} else { } else {

View File

@ -71,7 +71,7 @@ fn process_instruction(
AccountMeta::new_readonly(*accounts[3].key, true), AccountMeta::new_readonly(*accounts[3].key, true),
], ],
); );
invoke(&instruction, &accounts)?; invoke(&instruction, accounts)?;
let instruction = Instruction::new_with_bytes( let instruction = Instruction::new_with_bytes(
*program_id, *program_id,
@ -83,7 +83,7 @@ fn process_instruction(
AccountMeta::new(*accounts[3].key, false), AccountMeta::new(*accounts[3].key, false),
], ],
); );
invoke(&instruction, &accounts)?; invoke(&instruction, accounts)?;
assert_eq!(accounts[2].try_borrow_mut_data()?[0], 3); assert_eq!(accounts[2].try_borrow_mut_data()?[0], 3);
assert_eq!(accounts[3].try_borrow_mut_data()?[0], 3); assert_eq!(accounts[3].try_borrow_mut_data()?[0], 3);
} }

View File

@ -26,7 +26,7 @@ fn process_instruction(
data: instruction_data.to_owned(), data: instruction_data.to_owned(),
program_id: *to_call, program_id: *to_call,
}; };
let _ = invoke(&instruction, &infos); let _ = invoke(&instruction, infos);
Err(42.into()) Err(42.into())
} }

View File

@ -27,7 +27,7 @@ fn process_instruction(
data: instruction_data.to_owned(), data: instruction_data.to_owned(),
program_id: *to_call, program_id: *to_call,
}; };
let _ = invoke(&instruction, &infos); let _ = invoke(&instruction, infos);
Ok(()) Ok(())
} }

View File

@ -27,5 +27,5 @@ fn process_instruction(
data: instruction_data.to_owned(), data: instruction_data.to_owned(),
program_id: *to_call, program_id: *to_call,
}; };
invoke(&instruction, &infos) invoke(&instruction, infos)
} }