Skip to content

Commit 28ad22f

Browse files
committed
fix clippy
1 parent ac15d76 commit 28ad22f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use sha2::{Digest, Sha256};
99
use std::collections::HashMap;
1010
use std::io::{self, BufRead, Write};
1111
use std::path::PathBuf;
12-
use std::process::{Command, Stdio};
13-
use std::{any, fs};
12+
use std::process::Command;
13+
use std::fs;
1414
use tari_common::configuration::Network;
1515
use tari_common_types::tari_address::{TariAddress, TariAddressFeatures};
1616
use tari_common_types::types::{CompressedPublicKey, PrivateKey};
@@ -304,7 +304,7 @@ async fn open_door<T: WalletClient>(
304304
}
305305
};
306306

307-
if day < 1 || day > 24 {
307+
if !(1..=24).contains(&day) {
308308
eprintln!("Error: Day must be between 1 and 24");
309309
return Err(anyhow!("Day must be between 1 and 24"));
310310
}
@@ -495,7 +495,7 @@ async fn show_day<T: WalletClient>(day: Option<u8>, client: T, no_scan: bool) ->
495495
}
496496
};
497497

498-
if day < 1 || day > 24 {
498+
if !(1..=24).contains(&day) {
499499
eprintln!("Error: Day must be between 1 and 24");
500500
return Err(anyhow!("Day must be between 1 and 24"));
501501
}

src/wallet_client.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
};
55

66
use anyhow::anyhow;
7-
use tokio::task;
87

98
#[async_trait::async_trait]
109
pub trait WalletClient {
@@ -46,15 +45,15 @@ impl WalletClient for BinaryWalletClient {
4645
let import_status = Command::new(&self.executable_path)
4746
.arg("import-view-key")
4847
.arg("-v")
49-
.arg(&view_key)
48+
.arg(view_key)
5049
.arg("-s")
51-
.arg(&spend_key)
50+
.arg(spend_key)
5251
.arg("-p")
5352
.arg("password1")
5453
.arg("-b")
5554
.arg("1435")
5655
.arg("-d")
57-
.arg(&wallet_file)
56+
.arg(wallet_file)
5857
.stdout(Stdio::null())
5958
.stderr(Stdio::null())
6059
.status();
@@ -87,7 +86,7 @@ impl WalletClient for BinaryWalletClient {
8786
let scan_status = Command::new(&self.executable_path)
8887
.arg("scan")
8988
.arg("-d")
90-
.arg(&wallet_file)
89+
.arg(wallet_file)
9190
.arg("-n")
9291
.arg("10000")
9392
.arg("-p")

0 commit comments

Comments
 (0)