Clippy work towards rust 1.38 (#6219)

This commit is contained in:
Michael Vines
2019-10-02 18:04:18 -07:00
committed by GitHub
parent c06876eb3d
commit 13fc518268
12 changed files with 75 additions and 78 deletions

View File

@@ -166,7 +166,7 @@ pub fn process_instruction(
trace!("keyed_accounts: {:?}", keyed_accounts);
if keyed_accounts.is_empty() {
Err(InstructionError::InvalidInstructionData)?;
return Err(InstructionError::InvalidInstructionData);
}
// 0th index is vote account
@@ -184,7 +184,7 @@ pub fn process_instruction(
VoteInstruction::Vote(vote) => {
datapoint_info!("vote-native", ("count", 1, i64));
if rest.len() < 2 {
Err(InstructionError::InvalidInstructionData)?;
return Err(InstructionError::InvalidInstructionData);
}
let (slot_hashes_and_clock, other_signers) = rest.split_at_mut(2);
@@ -198,7 +198,7 @@ pub fn process_instruction(
}
VoteInstruction::Withdraw(lamports) => {
if rest.is_empty() {
Err(InstructionError::InvalidInstructionData)?;
return Err(InstructionError::InvalidInstructionData);
}
let (to, rest) = rest.split_at_mut(1);
let to = &mut to[0];