chore: cargo +nightly clippy --fix -Z unstable-options

This commit is contained in:
Alexander Meißner
2021-06-18 15:34:46 +02:00
committed by Michael Vines
parent 3570b00560
commit 6514096a67
177 changed files with 1021 additions and 1021 deletions

View File

@@ -30,7 +30,7 @@ pub fn process_instruction(
return Err(InstructionError::InvalidAccountOwner);
}
deserialize(&config_account.data()).map_err(|err| {
deserialize(config_account.data()).map_err(|err| {
ic_msg!(
invoke_context,
"Unable to deserialize config account: {}",
@@ -130,7 +130,7 @@ pub fn process_instruction(
config_keyed_account
.try_account_ref_mut()?
.data_as_mut_slice()[..data.len()]
.copy_from_slice(&data);
.copy_from_slice(data);
Ok(())
}
@@ -216,7 +216,7 @@ mod tests {
let (_, config_account) = create_config_account(keys);
assert_eq!(
Some(MyConfig::default()),
deserialize(get_config_data(&config_account.borrow().data()).unwrap()).ok()
deserialize(get_config_data(config_account.borrow().data()).unwrap()).ok()
);
}
@@ -241,7 +241,7 @@ mod tests {
);
assert_eq!(
Some(my_config),
deserialize(get_config_data(&config_account.borrow().data()).unwrap()).ok()
deserialize(get_config_data(config_account.borrow().data()).unwrap()).ok()
);
}
@@ -321,11 +321,11 @@ mod tests {
),
Ok(())
);
let meta_data: ConfigKeys = deserialize(&config_account.borrow().data()).unwrap();
let meta_data: ConfigKeys = deserialize(config_account.borrow().data()).unwrap();
assert_eq!(meta_data.keys, keys);
assert_eq!(
Some(my_config),
deserialize(get_config_data(&config_account.borrow().data()).unwrap()).ok()
deserialize(get_config_data(config_account.borrow().data()).unwrap()).ok()
);
}
@@ -454,11 +454,11 @@ mod tests {
),
Ok(())
);
let meta_data: ConfigKeys = deserialize(&config_account.borrow().data()).unwrap();
let meta_data: ConfigKeys = deserialize(config_account.borrow().data()).unwrap();
assert_eq!(meta_data.keys, keys);
assert_eq!(
new_config,
MyConfig::deserialize(get_config_data(&config_account.borrow().data()).unwrap())
MyConfig::deserialize(get_config_data(config_account.borrow().data()).unwrap())
.unwrap()
);
@@ -646,11 +646,11 @@ mod tests {
),
Ok(())
);
let meta_data: ConfigKeys = deserialize(&config_account.borrow().data()).unwrap();
let meta_data: ConfigKeys = deserialize(config_account.borrow().data()).unwrap();
assert_eq!(meta_data.keys, keys);
assert_eq!(
new_config,
MyConfig::deserialize(get_config_data(&config_account.borrow().data()).unwrap())
MyConfig::deserialize(get_config_data(config_account.borrow().data()).unwrap())
.unwrap()
);

View File

@@ -54,5 +54,5 @@ pub fn create_account(
/// transaction containing this instruction.
pub fn store(date_pubkey: &Pubkey, date: Date<Utc>) -> Instruction {
let date_config = DateConfig::new(date);
config_instruction::store(&date_pubkey, true, vec![], &date_config)
config_instruction::store(date_pubkey, true, vec![], &date_config)
}