Fix clippy lints

This commit is contained in:
Jack Grigg 2019-02-07 13:01:54 +00:00
parent acd8c395f3
commit c51a90f4de
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
2 changed files with 6 additions and 11 deletions

View File

@ -103,10 +103,7 @@ pub unsafe extern "C" fn Java_cash_z_wallet_sdk_jni_JniConverter_initAccountsTab
)
})
.collect();
let extfvks: Vec<_> = extsks
.iter()
.map(|extsk| ExtendedFullViewingKey::from(extsk))
.collect();
let extfvks: Vec<_> = extsks.iter().map(ExtendedFullViewingKey::from).collect();
match init_accounts_table(&db_data, &extfvks) {
Ok(()) => {
@ -155,7 +152,7 @@ pub unsafe extern "C" fn Java_cash_z_wallet_sdk_jni_JniConverter_initBlocksTable
.get_string(db_data)
.expect("Couldn't get Java string!")
.into();
let time = if time >= 0 && time <= (u32::max_value() as jlong) {
let time = if time >= 0 && time <= jlong::from(u32::max_value()) {
time as u32
} else {
error!("time argument must fit in a u32");
@ -336,8 +333,7 @@ pub unsafe extern "C" fn Java_cash_z_wallet_sdk_jni_JniConverter_sendToAddress(
&db_data,
SAPLING_CONSENSUS_BRANCH_ID,
prover,
account,
&extsk,
(account, &extsk),
&to,
value,
memo,

View File

@ -449,8 +449,7 @@ pub fn send_to_address(
db_data: &str,
consensus_branch_id: u32,
prover: impl TxProver,
account: u32,
extsk: &ExtendedSpendingKey,
(account, extsk): (u32, &ExtendedSpendingKey),
to: &PaymentAddress<Bls12>,
value: Amount,
memo: Option<Memo>,
@ -523,10 +522,10 @@ pub fn send_to_address(
// Select notes
let notes = stmt_select_notes.query_and_then::<_, Error, _, _>(
&[
account as i64,
i64::from(account),
value.0,
value.0,
(height - ANCHOR_OFFSET) as i64,
i64::from(height - ANCHOR_OFFSET),
],
|row| {
let mut diversifier = Diversifier([0; 11]);