Selaa lähdekoodia

bin: clippy lints.

parazyd 4 vuotta sitten
vanhempi
sitoutus
ed2fdae2da
3 muutettua tiedostoa jossa 5 lisäystä ja 6 poistoa
  1. 0 2
      src/bin/cashierd.rs
  2. 1 2
      src/bin/darkfid.rs
  3. 4 2
      src/rpc/jsonrpc.rs

+ 0 - 2
src/bin/cashierd.rs

@@ -5,7 +5,6 @@ use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use clap::clap_app;
 use easy_parallel::Parallel;
-use incrementalmerkletree::bridgetree::BridgeTree;
 use log::{debug, info, trace};
 use rand::rngs::OsRng;
 use serde_json::{json, Value};
@@ -18,7 +17,6 @@ use drk::{
     client::Client,
     crypto::{
         keypair::{PublicKey, SecretKey},
-        merkle_node::MerkleNode,
         proof::VerifyingKey,
     },
     rpc::{

+ 1 - 2
src/bin/darkfid.rs

@@ -5,7 +5,6 @@ use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use clap::clap_app;
 use easy_parallel::Parallel;
-use incrementalmerkletree::bridgetree::BridgeTree;
 use log::{debug, info};
 use num_bigint::BigUint;
 use serde_json::{json, Value};
@@ -17,7 +16,7 @@ use drk::{
     circuit::{MintContract, SpendContract},
     cli::{Config, DarkfidConfig},
     client::Client,
-    crypto::{keypair::PublicKey, merkle_node::MerkleNode, proof::VerifyingKey},
+    crypto::{keypair::PublicKey, proof::VerifyingKey},
     rpc::{
         jsonrpc::{
             error as jsonerr, request as jsonreq, response as jsonresp, send_raw_request,

+ 4 - 2
src/rpc/jsonrpc.rs

@@ -145,9 +145,11 @@ pub async fn send_raw_request(url: &str, data: Value) -> Result<JsonResult, Erro
 
     let host = parsed_url
         .host()
-        .ok_or(Error::UrlParseError(format!("Missing host in {}", url)))?
+        .ok_or_else(|| Error::UrlParseError(format!("Missing host in {}", url)))?
         .to_string();
-    let port = parsed_url.port().ok_or(Error::UrlParseError(format!("Missing port in {}", url)))?;
+    let port = parsed_url
+        .port()
+        .ok_or_else(|| Error::UrlParseError(format!("Missing port in {}", url)))?;
 
     let socket_addr = {
         let host = host.clone();