From 3eca767089691f0a8acb0e0b5ef77093105b0933 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Wed, 17 Aug 2022 02:31:09 +0200 Subject: [PATCH] fix clippy warnings --- neon/native/src/crypto.rs | 2 +- neon/native/src/transaction.rs | 11 ++++------- rust-bins/duniter-dbex/src/print_found_data.rs | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/neon/native/src/crypto.rs b/neon/native/src/crypto.rs index c28652049..afa75f9a3 100644 --- a/neon/native/src/crypto.rs +++ b/neon/native/src/crypto.rs @@ -64,7 +64,7 @@ pub fn seed_to_expanded_base58_secret_key(mut cx: FunctionContext) -> JsResult<J pub fn sha256(mut cx: FunctionContext) -> JsResult<JsString> { let str_datas = cx.argument::<JsString>(0)?.value(); - Ok(cx.string(Hash::compute(&str_datas.as_bytes()).to_hex().to_uppercase())) + Ok(cx.string(Hash::compute(str_datas.as_bytes()).to_hex().to_uppercase())) } pub fn verify(mut cx: FunctionContext) -> JsResult<JsBoolean> { diff --git a/neon/native/src/transaction.rs b/neon/native/src/transaction.rs index 7ba393d68..64e99f7f9 100644 --- a/neon/native/src/transaction.rs +++ b/neon/native/src/transaction.rs @@ -139,13 +139,10 @@ fn source_is_unlockable_inner( tx_issuers: &[ed25519::PublicKey], utxo_script: &str, ) -> bool { - if let Ok(utxo_script) = duniter_core::documents_parser::wallet_script_from_str(&utxo_script) { - if let Ok(unlockable_on) = SourceV10::unlockable_on( - &tx_issuers, - &proofs.unlocks, - source_written_on, - &utxo_script, - ) { + if let Ok(utxo_script) = duniter_core::documents_parser::wallet_script_from_str(utxo_script) { + if let Ok(unlockable_on) = + SourceV10::unlockable_on(tx_issuers, &proofs.unlocks, source_written_on, &utxo_script) + { // All proofs are valid and **seem** useful // (it is too costly to determine the minimum set of proof that is strictly necessary and sufficient). unlockable_on <= current_bc_time diff --git a/rust-bins/duniter-dbex/src/print_found_data.rs b/rust-bins/duniter-dbex/src/print_found_data.rs index 35e79d65b..ddae07203 100644 --- a/rust-bins/duniter-dbex/src/print_found_data.rs +++ b/rust-bins/duniter-dbex/src/print_found_data.rs @@ -288,14 +288,14 @@ fn entry_to_rows( } = entry; match value { Value::Object(value_json_map) => { - let row_map = map_entry_by_properties(&only_properties_set, key, value_json_map); + let row_map = map_entry_by_properties(only_properties_set, key, value_json_map); caps_to_rows_maps(row_map, captures_names, captures_opt) } Value::Array(json_array) => json_array .into_iter() .map(|sub_value| { if let Value::Object(sub_value_json_map) = sub_value { - map_entry_by_properties(&only_properties_set, key.clone(), sub_value_json_map) + map_entry_by_properties(only_properties_set, key.clone(), sub_value_json_map) } else { unreachable!() } -- GitLab