Skip to content
Snippets Groups Projects
Commit 3eca7670 authored by Éloïs's avatar Éloïs
Browse files

fix clippy warnings

parent 8098931a
No related branches found
No related tags found
No related merge requests found
...@@ -64,7 +64,7 @@ pub fn seed_to_expanded_base58_secret_key(mut cx: FunctionContext) -> JsResult<J ...@@ -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> { pub fn sha256(mut cx: FunctionContext) -> JsResult<JsString> {
let str_datas = cx.argument::<JsString>(0)?.value(); 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> { pub fn verify(mut cx: FunctionContext) -> JsResult<JsBoolean> {
......
...@@ -139,13 +139,10 @@ fn source_is_unlockable_inner( ...@@ -139,13 +139,10 @@ fn source_is_unlockable_inner(
tx_issuers: &[ed25519::PublicKey], tx_issuers: &[ed25519::PublicKey],
utxo_script: &str, utxo_script: &str,
) -> bool { ) -> bool {
if let Ok(utxo_script) = duniter_core::documents_parser::wallet_script_from_str(&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( if let Ok(unlockable_on) =
&tx_issuers, SourceV10::unlockable_on(tx_issuers, &proofs.unlocks, source_written_on, &utxo_script)
&proofs.unlocks, {
source_written_on,
&utxo_script,
) {
// All proofs are valid and **seem** useful // All proofs are valid and **seem** useful
// (it is too costly to determine the minimum set of proof that is strictly necessary and sufficient). // (it is too costly to determine the minimum set of proof that is strictly necessary and sufficient).
unlockable_on <= current_bc_time unlockable_on <= current_bc_time
......
...@@ -288,14 +288,14 @@ fn entry_to_rows( ...@@ -288,14 +288,14 @@ fn entry_to_rows(
} = entry; } = entry;
match value { match value {
Value::Object(value_json_map) => { 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) caps_to_rows_maps(row_map, captures_names, captures_opt)
} }
Value::Array(json_array) => json_array Value::Array(json_array) => json_array
.into_iter() .into_iter()
.map(|sub_value| { .map(|sub_value| {
if let Value::Object(sub_value_json_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 { } else {
unreachable!() unreachable!()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment